Python Revision Tour || True or False || Class 12
1. The expression int(x) implies that the variable x is converted to integer.
2. The value of the expressions 4/ (3*(2 - 1)) and 4/3*(2- 1) is the same.
3. The value of the expressions 4/ (3*(4 - 2) and 4/3*(4-2) is the same.
4. The expression 2**2**3 is evaluated as: (2**2) **3.
5. A string can be surrounded by three sets of single quotation marks or by three sets of double quotation marks.
6. Variables can be assigned only once.
7. In Python, a variable is a placeholder for data.
8. In Python, only if statement has else clause.
9. Python loops can also have else clause.
10. In a nested loop, a break statement terminates all the nested loops in one go.
11. Do both the following represent the same list.
['a', b, c']
['c', 'a', 'b']
12. A list may contain any type of objects except another list.
13. There is no conceptual limit to the size of a list.
14. All elements in a list must be of the same type.
15. A given object may appear in a list more than once.
16. The keys of a dictionary must be of immutable types.
17. You can combine a numeric value and a string by using the + symbol.
18. The clear( ) removes all the elements of dictionary but does not delete the empty dictionary.
19. The max() and min() when used with tuples, can work if elements of the tuple are all of the same type.
20. A list of characters is similar to a string type.
21. For any index n, s [: n] + s [n :] will give you original string s.
22. A dictionary can contain keys of any valid Python types.
23. The two statements x int(22.0/7) and x = int(22/7.0) yield the same results.
24. The given statement: x + 1 = x is a valid statement.
25. List slice is a list in itself.
26. Relational operators return either true or false.
27. break, continue, pass are the three conditional statements.
28. The % (modulus) operator cannot be used with the float data type.
29. The range() function is used to specify the length of a for-in loop.
30. Assignment operator can be used in place of equality operator in the test condition.
31. Comments in Python begin with a "$" symbol.
32. In print() function, if you use a concatenate operator (+) between two strings, both the strings are
joined with a space in between them.
33. If we execute Python code using prompt ">>>" then we call it an interpreter.
34. Lists are immutable while strings are mutable.
35. The keys of a dictionary must be of immutable types.
36. Lists and strings in Python support two-way indexing.
37. Tuples can be nested and can contain other compound objects like lists, dictionaries and other tuples.
Answer =
1. True
2. True
3. False
4. False
5. True
6. False
7. False
8. False
9. True
10. False
11. False
12. False
13. True
14. False
15. True
16. True
17. False
18. True
19. True
20. False
21. True
22. False
23. True
24. False
25. True
26. True
27. False
28. True
29. True
30. False
31. False
32. False
33. True
34. False
35. True
36. True
37. True
thank you so much, ur a life saver
ReplyDeleteWelcome : )
DeleteThank you for this
ReplyDeleteWelcome : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )