- Which of the following is true about Python variables?
View Answer
Correct answer: B — They can change type dynamically
- What will be printed?
1 print("Eduinq"[0:3]) View Answer
Correct answer: A — Edu
- Which operator is used for floor division in Python?
View Answer
Correct answer: B — //
- What is the default return value of a function that does not explicitly return anything?
View Answer
Correct answer: A — None
- What will be printed?
1 print("Eduinq" * 2) View Answer
Correct answer: A — EduinqEduinq
- Which of the following is immutable in Python?
View Answer
Correct answer: C — Tuple
- Which symbol is used for comments in Python?
View Answer
Correct answer: B — #
- What will be printed?
1 print(type(True)) View Answer
Correct answer: B — <class 'bool'>
- Which of the following is not a Python keyword?
View Answer
Correct answer: C — eval
- Which function is used to get user input in Python 3?
View Answer
Correct answer: B — input()
- What is the output of print(2**32)?
View Answer
Correct answer: B — 512
- Which of the following is immutable in Python?
View Answer
Correct answer: C — Tuple
- What is the output of print(type(True))?
View Answer
Correct answer: B — <class 'bool'>
- Which symbol is used for comments in Python?
View Answer
Correct answer: B — #
- What will print(10 == 10.0) output?
View Answer
Correct answer: A — True
- Which of the following is used to define a block of code in Python?
View Answer
Correct answer: B — Indentation
- What is the output of print("Eduinq"[::-1])?
View Answer
Correct answer: A — qniudE
- Which function converts a string to an integer in Python?
View Answer
Correct answer: B — int()
- What is the output of print(5//2)?
View Answer
Correct answer: B — 2
- Which of the following is not a valid data type in Python?
View Answer
Correct answer: B — Array
- What is the output of print(type(None))?
View Answer
Correct answer: A — <class 'NoneType'>
- Which operator is used for exponentiation in Python?
View Answer
Correct answer: B — **
- What is the output of print(3*'Eduinq')?
View Answer
Correct answer: A — EduinqEduinqEduinq
- Which of the following is used to check object identity?
View Answer
Correct answer: B — is
- What is the output of print(10%3)?
View Answer
Correct answer: A — 1
- Which of the following is not a valid Boolean value in Python?
View Answer
Correct answer: D — Yes
- What is the output of print(type(3.14))?
View Answer
Correct answer: B — <class 'float'>
- Which of the following is used to import a module in Python?
View Answer
Correct answer: B — import
- What is the output of print(len("Eduinq"))?
View Answer
Correct answer: B — 7
- Which of the following is not a valid escape character in Python?
View Answer
Correct answer: D — x
- What is the output of print(2==2 and 3==4)?
View Answer
Correct answer: B — False
- Which of the following is used to terminate a loop in Python?
View Answer
Correct answer: C — break
- What is the output of print(2!=3)?
View Answer
Correct answer: A — True
- Which of the following is used to continue to the next iteration in a loop?
View Answer
Correct answer: B — continue
- What is the output of print("Eduinq".upper())?
View Answer
Correct answer: B — EDUINQ
- Which of the following is not a valid numeric type in Python?
View Answer
Correct answer: D — decimal
- What is the output of print(5==5 or 2==3)?
View Answer
Correct answer: A — True
- Which of the following is used to define a class in Python?
View Answer
Correct answer: A — class
- What is the output of print("Eduinq".find("q"))?
View Answer
Correct answer: A — 5
- Which of the following is not a valid string method in Python?
View Answer
Correct answer: C — append()
- What is the output of print(10//3)?
View Answer
Correct answer: A — 3
- Which of the following is used to check membership in Python?
View Answer
Correct answer: A — in
- What is the output of print("Eduinq"[-1])?
View Answer
Correct answer: B — q
- Which of the following is not a valid Python numeric literal?
View Answer
Correct answer: C — 07
- What is the output of print("5" + "5")?
View Answer
Correct answer: B — 55
- Which of the following is used to convert a list into a tuple?
View Answer
Correct answer: B — tuple()
- What is the output of print(type(3/3))?
View Answer
Correct answer: B — <class 'float'>
- Which of the following is used to remove whitespace from both ends of a string?
View Answer
Correct answer: A — strip()
- What is the output of print(2*3+4)?
View Answer
Correct answer: A — 10
- Which of the following is used to display the documentation string of a function in Python?
View Answer
Correct answer: A — help()