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 "apple".upper()? Apple apple APPLE 2 / 50 What is the result of 10 > 5 and 5 < 2? False None True 3 / 50 Which keyword is used to import all contents of a module? all import_all * 4 / 50 What does break do in a loop? Skips one iteration Ends the loop Repeats the loop 5 / 50 What is the purpose of the pass statement? To raise an error To do nothing To return a value 6 / 50 How do you start a comment in Python? // * # 7 / 50 What is the result of bool([1, 2])? False True None 8 / 50 What is the output of "Hello" + "World"? Error Hello World HelloWorld 9 / 50 What is the output of len((1, 2, 3))? 4 3 2 10 / 50 How do you convert a list to a set in Python? list(set) set(list) {list} 11 / 50 How do you remove the last item from a list? list.pop() list.remove() list.delete() 12 / 50 How do you create a lambda function in Python? function(x): x + 1 lambda x: x + 1 lambda x -> x + 1 13 / 50 How do you convert a string to lowercase? str.lowercase() str.lower() lower(str) 14 / 50 What is the result of bool("")? True False None 15 / 50 What is the result of "apple".find("z")? None -1 0 16 / 50 What is the result of "apple" * 2? appleapple ['apple', 'apple'] Error 17 / 50 What is the result of int(5.9)? Error 5 6 18 / 50 How do you sort a dictionary by its keys? sorted(dict) dict.sort() dict.sortkeys() 19 / 50 What is the result of "Python".find("o")? 4 -1 3 20 / 50 How do you create a single-line string in Python? "Hello" """Hello""" '''Hello''' 21 / 50 What is the result of "Python" * 2? PythonPython Error PythonPython 22 / 50 What is the output of "Python".split("t")? ['Py', 'hon'] ['P', 'y', 't', 'h', 'o', 'n'] ['Python'] 23 / 50 How do you remove whitespace from the beginning and end of a string? strip() strip(" ") clean() 24 / 50 How do you delete a key-value pair in a dictionary? del dict[key] pop dict[key] remove dict[key] 25 / 50 What does enumerate([10, 20, 30]) return? A dictionary An iterator A list 26 / 50 What is the result of 10 // 3? 3 3.33 3 27 / 50 What is the output of print(3 == 3.0)? False Error True 28 / 50 How do you define a function in Python? function func() def func() def func(): 29 / 50 What does is compare in Python? Values only Memory usage Object identities 30 / 50 How do you get the ASCII value of a character? ord('A') ord.value('A') ascii('A') 31 / 50 What is the result of 5 * 2 == 10? False True Error 32 / 50 What is the correct way to create a list in Python? [1, 2, 3] (1, 2, 3) {1, 2, 3} 33 / 50 What is the output of [1, 2, 3][1]? 2 1 3 34 / 50 What does sorted([3, 1, 2]) return? [1, 2, 3] Error [3, 1, 2] 35 / 50 How do you join elements of a list into a string? concat(list) "".join(list) combine(list) 36 / 50 Which data structure does set() create? A list A set A dictionary 37 / 50 How do you create an empty dictionary? {} [] () 38 / 50 Which keyword is used to check a condition in Python? if loop func 39 / 50 How do you create a set in Python? {1, 2, 3} (1, 2, 3) [1, 2, 3] 40 / 50 What is the output of print(2 + 3)? 5 5 23 41 / 50 How do you access the value of a key in a dictionary? dict[key] dict.value(key) key.dict() 42 / 50 How do you reverse a list in Python? list.reverse() list[::-1] reverse(list) 43 / 50 What is the output of type("123")? <class 'int'> <class 'str'> <class 'float'> 44 / 50 What does the pop() method do in a list? Sorts the list Adds an element Removes the last element 45 / 50 What will len("Hello") return? 5 6 4 46 / 50 How do you declare a variable in Python? declare x = 5 x = 5 var x = 5 47 / 50 How do you open a file for reading in Python? open(file, "a") open(file, "r") open(file, "w") 48 / 50 How do you find the index of an element in a list? index() find() locate() 49 / 50 What is the output of "abc".capitalize()? ABC Abc abc 50 / 50 What is the result of 10 != 5? True Error False Your score is LinkedIn Facebook VKontakte 0% Exit