python test1
python test1
a) Wick van Rossum b) Rasmus Lerdorf c) Guido van Rossum d) Niene Stom
a) Python code is both compiled and interpreted c) Python code is only compiled
b) Python code is neither compiled nor interpreted d) Python code is only interpreted
a) 7 b) 2 c) 4 d) 1
10. Which of the following character is used to give single-line comments in Python?
a) // b) # c) ! d) /*
i=1
while True:
if i%3 == 0:
break
print(i)
a) 1 2 3i + = 1 c) 1 2 d) none of the
mentioned
b) error
12. What is the order of precedence in python?
a) Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
b) Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
c) Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
d) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
13. What will be the output of the following Python code snippet if x=1?
x<<2
a) 4 b) 2 c) 1 d) 8
2**(3**2)
(2**3)**2
2**3**2
a) 512, 64, 512 c) 64, 512, 64
b) 512, 512, 512 d) 64, 64, 64
17. Which of the following is not a core data type in Python programming?
a) Tuples b) Lists c) Class d) Dictionary
1. >>>"a"+"bc"
a) bc b) abc c) a d) bca
20. Which of the following statements is used to create an empty set in Python?
a) ( ) b) [ ] c) { } d) set()
24. What will be the output of the following Python expression if x=15 and y=12?
x & y
a) b1101 c) 12
b) 0b1101 d) 1101
25. What will be the output of the following Python code?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
a) 1 2 3 4 5 6 c) error
b) 1 2 3 4 5 6 7 d) none of the mentioned