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 len("Pythonn")? 8 6 7 2 / 50 What does int("10") return? An integer A string A float 3 / 50 What is the result of range(3)? A list A tuple A range object 4 / 50 Which method is used to remove an item from a list? delete() erase() remove() 5 / 50 What does x += 1 mean? x = x - 1 x = x + 1 x = x / 1 6 / 50 How do you create an empty dictionary? [] {} () 7 / 50 How do you get the remainder of a division? // % divmod() 8 / 50 What is the result of bool("")? None True False 9 / 50 What is the result of min([3, 1, 2])? 2 3 1 10 / 50 How do you get the keys of a dictionary? dict.values() dict.keys() dict.items() 11 / 50 How do you declare a variable in Python? var x = 5 x = 5 declare x = 5 12 / 50 What is the result of "Python"[::-1]? Python nohtyP Error 13 / 50 How do you create a multi-line comment in Python? # " " ''' ''' 14 / 50 Which keyword is used to check a condition in Python? func loop if 15 / 50 What is the output of "hello".count("l")? 1 3 2 16 / 50 How do you get the length of a dictionary? count(dict) len(dict) len(list) 17 / 50 How do you access the value of a key in a dictionary? key.dict() dict[key] dict.value(key) 18 / 50 What is the output of [x for x in range(3)]? [0, 1, 2, 3] [3] [0, 1, 2] 19 / 50 What is the default value of end in a print() function? "n" "." "," 20 / 50 How do you open a file in write mode? open("file", "r") open("file", "w") open("file") 21 / 50 How do you handle exceptions in Python? handle if-else try-except 22 / 50 What is the output of 2 * '3' in Python? 33 6 Error 23 / 50 What is the result of "apple".find("z")? None -1 0 24 / 50 What is the result of [1, 2, 3] * 2? Error [2, 4, 6] [1, 2, 3, 1, 2, 3] 25 / 50 What is the output of bool(None)? True Error False 26 / 50 How do you find the index of an element in a list? index() find() locate() 27 / 50 What is the result of bin(10)? Binary 1010 0b1010 28 / 50 How do you create a set in Python? {1, 2, 3} [1, 2, 3] (1, 2, 3) 29 / 50 Which operator is used for equality comparison? = === == 30 / 50 What is the keyword used to define a function in Python? def func define 31 / 50 What is the output of 10 / 3? 3.333... 3 3 32 / 50 How do you remove whitespace from the beginning and end of a string? clean() strip(" ") strip() 33 / 50 How do you check the type of a variable in Python? typeof(var) isinstance(var) type(var) 34 / 50 How do you add an element to a list? list.appendlist() list.append() list.add() 35 / 50 What does type(10.5) return? <class 'str'> <class 'float'> <class 'int'> 36 / 50 How do you get the length of a list? count(list) len(list) size(list) 37 / 50 How do you convert a list into a set? list.unique() set(list) list.set() 38 / 50 What keyword is used to define a loop in Python? for iterate repeat 39 / 50 What is the default return value of a function in Python? None Error 0 40 / 50 What is the output of "Hello" + "World"? Hello World Error HelloWorld 41 / 50 What is the keyword used to define a class in Python? def class object 42 / 50 How do you access an element by key in a dictionary? dict["key"] dict.get("key") dict.key 43 / 50 What is the result of 3 > 1 and 4 > 5? False True None 44 / 50 How do you create a dictionary in Python? [] dict() {} 45 / 50 What is the result of round(2.5)? 3 2 2 46 / 50 What is the result of list(range(3, 6))? [3, 6] [3, 4, 5] [1, 2, 3, 4, 5, 6] 47 / 50 What is the output of print(2 + 3)? 23 5 5 48 / 50 How do you get the absolute value of a number? abs.value(num) absolute(num) abs(num) 49 / 50 How do you sort a dictionary by its keys? dict.sortkeys() sorted(dict) dict.sort() 50 / 50 What does str(123) return? A float A string An integer Your score is LinkedIn Facebook VKontakte 0% Exit