DSA 2019 Quiz Quiz August 8, 2021BIM NotesLeave a Comment on DSA 2019 Quiz Unit 3 Built in Data Types 1 / 19 Which of the following is not a numeric data type in Python? A) int B) float C) complex D) str 2 / 19 What is the result of the expression 5 // 2 ? A) 2.5 B) 2 C) 2.0 D) 3 3 / 19 What will be the output of the following code: print("Hello" + " " + "World")? A) HelloWorld B) Hello World C) Hello World D) Hello-World 4 / 19 Which method can be used to convert a string to uppercase in Python? A) upper() B) capitalize() C) title() D) uppercase() 5 / 19 What will be the result of the expression bool(0)? A) True B) False C) 0 D) None 6 / 19 Which function is used to sort a list in Python? A) sort() B) sorted() C) order() D) arrange() 7 / 19 What will be the output of the following code: sorted([3, 1, 2])? A) [3, 1, 2] B) [1, 2, 3] C) [2, 1, 3] D) [3, 2, 1] 8 / 19 Which of the following is used to create a binary literal ? A) 0b B) 0x C) 0o D) 0d 9 / 19 Which of the following is a mutable sequence type ? A) str B) list C) tuple D) range 10 / 19 What will be the output of the following code: len([1, 2, 3, 4])? A) 3 B) 4 C) 5 D) 6 11 / 19 Which of the following is a built-in mapping type ? A) list B) set C) dict D) tuple 12 / 19 Which method can be used to check if all characters in a string are digits? A) isdigit() B) isalpha() C) isalnum() D) isspace() 13 / 19 What is the output of the following code: sorted(['banana', 'apple', 'cherry'])? A) ['cherry', 'banana', 'apple'] B) ['banana', 'apple', 'cherry'] C) ['apple', 'banana', 'cherry'] D) ['apple', 'cherry', 'banana'] 14 / 19 Which of the following sequence types is immutable? A) list B) tuple C) bytearray D) deque 15 / 19 Which method is used to get a value from a dictionary in Python if the key might not exist? A) get() B) find() C) retrieve() D) fetch() 16 / 19 Which method is used to split a string into a list? A) split() B) join() C) divide() D) partition() 17 / 19 Which method converts a bytes object to a string in Python? A) decode() B) encode() C) str() D) int() 18 / 19 Which function is used to round a number to the nearest integer in Python? A) round() B) int() C) ceil() D) floor() 19 / 19 Which method can be used to check if a string starts with a specific substring in Python? A) startswith() B) beginswith() C) find() D) match() Your score isThe average score is 0% 0% Restart quiz