43- What will be the output of print(5 * 2 ** 2)?
Anonymous Quiz
5%
a) 10
86%
b) 20
4%
c) 30
5%
d) 15
45- What will be the output of print("Hello".replace("l", "L"))?
Anonymous Quiz
70%
a) HeLLo
7%
b) Hello
7%
c) HeLLLo
16%
d) none
46- Which method is used to remove a specific element from a list?
Anonymous Quiz
20%
a) pop()
61%
b) remove()
7%
c) discard()
13%
d) delete()
48- What will be the result of print("Hello"[1:4])?
Anonymous Quiz
7%
a) Hel
65%
b) ell
4%
c) llo
24%
d) ello
49- Which of the following is used to read a file in Python?
Anonymous Quiz
20%
a) open()
45%
b) read()
24%
c) file()
11%
d) input()
50- How can you make a string in Python all uppercase?
Anonymous Quiz
68%
a) upper()
13%
b) capitalize()
4%
c) toupper()
16%
d) uppercase()
👍1
51- What is the output of print(5 < 10 and 10 < 20)?
Anonymous Quiz
84%
a) True
13%
b) False
0%
c) 5
4%
d) None
53- Which method is used to return a string with the first letter capitalized?
Anonymous Quiz
70%
a) capitalize()
11%
b) upper()
0%
c) noscript()
20%
d) first_upper()
56- In Python, single-line comments are created using the # symbol.
Anonymous Quiz
88%
a) True
13%
b) False
58- The for loop in Python can be used to iterate over strings.
Anonymous Quiz
89%
a) True
11%
b) False
60- The in operator is used to check if a value exists within a list.
Anonymous Quiz
82%
a) True
18%
b) False
62- A method in a class cannot be called without creating an instance of the class.
Anonymous Quiz
61%
a) True
39%
b) False
63- The __init__ method in Python is called the constructor of a class.
Anonymous Quiz
87%
a) True
13%
b) False
64- In Python OOP, encapsulation means hiding the class data by making attributes private.
Anonymous Quiz
87%
a) True
13%
b) False