NEW
Font size
WorksheetsBasic Python
Total questions: 10
Worksheet time: 12mins
What is output of 33 == 33.0
False
True
33
None of the Above
How can we swap two numbers
a = 10
b = 20
in python without using third variable?
a = b
b = a
a,b = b,a
a=20,b=10
b = a
a = b
Which of the following are valid ways to specify the string literal foo'bar in Python?
'foo''bar'
'foo'bar'
"foo'bar"
'foo'+'bar'
>>> print(r'foo\\bar\nbaz')
Which of the following is the correct output?
foo\\bar\nbaz
foo\bar\nbaz
foo\\barnbaz
foo\bar
baz
Which of the following is not a Python built-in function:
diff()
round()
isinstance()
map()
Which of the following is false statement in python
int(144)==144
int('144')==144
int(144.0)==144
None of the above
What is the output for −
'Hello world' [1:2]
Hello
e
world
Syntax error
What is the output of this code snippet?
10
Runtime Error
Syntax error
0
Suppose you are given with two sets(s1&s2) then what is the output of the code s1+s2
Adds the elements of the both the sets.
Removes the repeating elements and adds both the sets.
It is an illegal command.
Output will be stored in S1.
What is the output of this code snippet?
2,2,2
1,2,5
1,2,3
ERROR
