Welcome to your Python Basic
1.
Which loop is used when the number of iterations is known?
2.
How many times will this loop run? for i in range(3): print(i)
3.
What will this code print? for i in range(1, 4): print(i, end=" ")
4.
Which keyword skips the current loop iteration?
5.
Which operator is used for equality comparison?
6.
What is the data type of "10"?
7.
Which error occurs when a variable is not defined?
8.
What does break do in a loop?
9.
What is the output of: print(bool(""))
10.
Which of the following is an immutable data type in Python?
11.
What is the data type of x = 10?
12.
What is the output of: x = 5 if x > 3: print("Yes")
13.
Which keyword is used for conditional statements in Python?
14.
What is the result of bool(0)?
15.
Which of the following creates a list?
16.
Which line will cause an error?
17.
What is the data type of the value 3.14 in Python?
18.
What is the output of the following code? x = True print(x)
19.
What is the output of: x = "Python" print(x[0])
20.
Which of the following causes a TypeError?
21.
Which function converts a value to an integer?
22.
What is the output of: print(len("Hello"))
23.
Which data type stores key–value pairs?
24.
Which of the following is a syntax error?
25.
What is the issue in this code? print("Hello)
26.
What does while True: indicate?
27.
What is the output of: print(2 + 3 * 4)
28.
What error occurs when accessing an invalid list index?
29.
What is wrong with this code? if x = 5: print(x)
30.
What is the output of: x = 10 x += 5 print(x)