Skip to main content

Posts

Showing posts with the label ЁЯРН Python MCQs (20 Questions)

ЁЯРН Python MCQs (20 Questions)

  ЁЯРН Python MCQs (20 Questions) 1️⃣ What is the output of this code? print ( type ([])) A.  <class 'tuple'> B.  <class 'list'> C.  <class 'dict'> D.  <class 'set'> ✅  Answer:   B 2️⃣ Which of the following is mutable in Python? A. Tuple B. String C. List D. Integer ✅  Answer:   C Example: my_list[0] = 10  is allowed. 3️⃣ What does  len("Python")  return? A. 5 B. 6 C. 7 D. Error ✅  Answer:   B 4️⃣ What will be the output? print (3 * "Hi" ) A. HiHiHi B. 3Hi C. Error D. Hi*3 ✅  Answer:   A 5️⃣ Which keyword is used to define a function in Python? A. function B. define C. def D. fun ✅  Answer:   C 6️⃣ What is the output? x = [1, 2, 3] print (x[-1]) A. 1 B. 2 C. 3 D. Error ✅  Answer:   C 7️⃣ Which data type is returned by  input() ? A. int B. float C. string D. boolean ✅  Answer:   C 8️⃣ What does  break  do in a loop? A. Skips one iteration B. ...