- In Python, print () by default adds which of the following as an end line argument?
- \t
- \n
- \s
- \r
- Which of the following is not true about variable names?
- The length of the variable name is fixed
- Can contain upper case or lowercase letters and digits 0-9
- Variable names cannot begin with a digit
- Variable names are case sensitive
- What does IDE stand for?
- Internet Data Evaluation
- Integrated Drive Electronics
- Integrated Development Enterprises
- Integrated Development Environment
- In Spyder, the command to clear the console is
- %reset
- %delete
- %del
- %clear
- Which of the following code cannot be used to initialize multiple variables with a common value?
- a, b, c = 55
- a, b, c = 55, 55, 55
- a = b = c = 55
- a = 55; b = a; c = b
- What will be the output after executing the following codes?
x=45
y=7
x%=y
print(x)- 6
- 42
- 3
- 52
- Which of the following is true with respect to the below codes?
a=4**3
b=pow(4,3)
- a == b
- a ≠ b
- a < b
- a > b
- What will be the output after executing the following codes?
x=8
if x>8:
print(20)
else:
print(10)- 20
- ValueError
- 10
- SyntaxError
- Which of the following conversion results in an error?
- int('10.8')
- float(10)
- int(10)
- float(10.8)
- Which of the following command is used to print the output 01-Jan-2020 ?
- print('01','Jan', sep=' ', end='-2020')
- print('01','Jan', sep='-', end='-2020')
- print('01','Jan', sep='-', end='2020')
- print('01','Jan','2020', sep='-', end='-2020\n')
- For which type of error does the interpreter runs the program and does not report an error?
- Semantic error
- Syntax error
- Runtime error
- Key error
- What will be the output after executing the following codes?
x=27
y=4
print(x//y)- SyntaxError
- 6.75
- 3
- 6
- Identify which of the following is not a valid variable name?
- X005 =10
- A.2 = 10
- N_s = 10
- r10 = 10
- What does the following statements do?
-
import sys
- Displays the current Python version
- Displays the operating system version
- Displays the location of the Python interpreter
- All of the above
print(sys.version)
- The operators 'is' & 'is not' are?
- Comparison Operators
- Identity Operators
- Membership Operators
- Relational Operators
- How many operands are there in the following arithmetic expression?
6 * 35 + 8 - (25 / 5)- 4
- 3
- 5
- 8
- What would be the datatype of variable 'c' after executing the following code?
a=5
b=6
c=print(a/b)- float
- Nonetype
- int
- object
- Which is not a valid assignment operator?
- **=
- +=
- //=
- %%=
- Which is not a valid bitwise operator?
- &
- ~
- ^
- <=
- The datatype of the variable a = (1i) is
- str
- complex
- SyntaxError
- tuple
Python MCQ-1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment