Coding Pyhton Coding Test 0% Time Limit 10 minutes Maximum Allowed Time Is over Your Paper Successfully Sent. coding Python 1 / 50 What is the result of float(10)? 10 10 Error 2 / 50 What is the output of 2 * '3' in Python? Error 33 6 3 / 50 What is the keyword used to define a function in Python? func define def 4 / 50 What is the output of print(3 == 3.0)? Error False True 5 / 50 What is the output of print(2 + 3)? 23 5 5 6 / 50 What is the result of max([1, 5, 3])? 3 5 1 7 / 50 How do you write a multi-line string in Python? " " """ """ ' ' 8 / 50 What is the result of "apple".upper()? apple APPLE Apple 9 / 50 What is the purpose of the elif statement? To define a function To check another condition To end a loop 10 / 50 What is the result of 3 < 2 and 2 < 4? None True False 11 / 50 What is the result of bool("")? False None True 12 / 50 How do you convert a list into a set? list.unique() set(list) list.set() 13 / 50 What is the result of bool([1, 2])? None True False 14 / 50 How do you define a constant in Python? define(var) Use uppercase names const var 15 / 50 How do you remove duplicates from a list? remove_duplicates() unique(list) list(set(list)) 16 / 50 How do you remove whitespace from the beginning and end of a string? strip() clean() strip(" ") 17 / 50 What is the output of "hello".count("l")? 1 2 3 18 / 50 What is the default return value of a function in Python? Error 0 None 19 / 50 What is the output of [x for x in range(3)]? [0, 1, 2] [3] [0, 1, 2, 3] 20 / 50 How do you handle exceptions in Python? handle try-except if-else 21 / 50 What is the result of min([3, 1, 2])? 3 1 2 22 / 50 How do you convert a string to lowercase? str.lowercase() str.lower() lower(str) 23 / 50 How do you declare a variable in Python? var x = 5 declare x = 5 x = 5 24 / 50 What is the output of "Hello" + "World"? HelloWorld Error Hello World 25 / 50 Which data structure does set() create? A set A dictionary A list 26 / 50 Which method is used to remove an item from a list? remove() erase() delete() 27 / 50 What does x += 1 mean? x = x - 1 x = x / 1 x = x + 1 28 / 50 How do you check if a string starts with a specific character? string.startswith("char") startswith("char") "char" in string 29 / 50 What is the result of len("Python")? 7 6 5 30 / 50 What is the result of list(range(3, 6))? [1, 2, 3, 4, 5, 6] [3, 6] [3, 4, 5] 31 / 50 How do you create a tuple in Python? {1, 2, 3} (1, 2, 3) [1, 2, 3] 32 / 50 How do you add an element to a list? list.appendlist() list.append() list.add() 33 / 50 How do you get the length of a list? len(list) count(list) size(list) 34 / 50 What is the result of 10 // 3? 3.33 3 10 35 / 50 How do you call a function my_function in Python? my_function my_function() call my_function 36 / 50 What does enumerate([10, 20, 30]) return? A dictionary A list An iterator 37 / 50 What is the result of abs(-10)? -10 10 0 38 / 50 What is the keyword used to define a class in Python? class object def 39 / 50 What is the output of bool(0)? False 0 True 40 / 50 How do you join elements of a list into a string? concat(list) combine(list) "".join(list) 41 / 50 How do you open a file for reading in Python? open(file, "a") open(file, "w") open(file, "r") 42 / 50 What is the result of len("Pythonn")? 7 6 8 43 / 50 How do you delete a key-value pair in a dictionary? del dict[key] pop dict[key] remove dict[key] 44 / 50 How do you split a string into a list? split(string) string.split() string.partition() 45 / 50 Which keyword is used to check for membership in a list? in contains in_list 46 / 50 What is the output of "Python".split("t")? ['P', 'y', 't', 'h', 'o', 'n'] ['Python'] ['Py', 'hon'] 47 / 50 What will len("Hello") return? 6 4 5 48 / 50 What does is compare in Python? Object identities Values only Memory usage 49 / 50 Which operator is used to find the remainder of division? % / // 50 / 50 What is the purpose of the pass statement? To do nothing To return a value To raise an error Your score is LinkedIn Facebook VKontakte 0% Exit