| 21. |
In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.
>>>x = 13 ? 2
The objective is to make sure x has an integer value, select all that apply (python 3.xx)
|
||||||||
|
Answer:
Option (d) |
| 22. |
What error occurs when you execute the following Python code snippet?
apple = mango
|
||||||||
|
Answer:
Option (b) |
| 23. |
What will be the output of the following Python code snippet?
def example(a):
a = a + '2'
a = a*2
return a
>>>example(""hello"")
|
||||||||
|
Answer:
Option (a) |
| 24. |
Which of the following results in a SyntaxError?
|
||||||||
|
Answer:
Option (c) |
| 25. |
What is the average value of the following Python code snippet?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
|
||||||||
|
Answer:
Option (a) |
| 26. |
Select all options that print.
hello-how-are-you
|
||||||||
|
Answer:
Option (c) |
| 27. |
What is the return value of trunc()?
|
||||||||
|
Answer:
Option (a) |
| 28. |
What is the output of print 0.1 + 0.2 == 0.3?
|
||||||||
|
Answer:
Option (b) |
| 29. |
Which of the following is not a complex number?
|
||||||||
|
Answer:
Option (c) |
| 30. |
What is the type of inf?
|
||||||||
|
Answer:
Option (c) |