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 3 ** 2 in Python? 9 12 6 2 / 50 What is the keyword used to define a class in Python? class object def 3 / 50 What is the output of 10 / 3? 3 3 3.333... 4 / 50 How do you iterate over dictionary keys? dict.items() dict.values() dict.keys() 5 / 50 What is the output of "Hello" + "World"? HelloWorld Hello World Error 6 / 50 What does x += 1 mean? x = x - 1 x = x / 1 x = x + 1 7 / 50 What does type(10.5) return? <class 'float'> <class 'int'> <class 'str'> 8 / 50 What is the output of bool(None)? Error True False 9 / 50 What is the result of 10 != 5? False True Error 10 / 50 Which data type is used to store a sequence of characters in Python? str float int 11 / 50 Which method adds an element to the end of a list? add() append() push() 12 / 50 What is the result of 5 >= 5? None False True 13 / 50 How do you sort a dictionary by its keys? dict.sort() sorted(dict) dict.sortkeys() 14 / 50 How do you create a lambda function in Python? lambda x: x + 1 function(x): x + 1 lambda x -> x + 1 15 / 50 What will len("Hello") return? 4 6 5 16 / 50 What is the output of len([1, 2, 3, 4])? 5 3 4 17 / 50 What is the result of min([3, 1, 2])? 2 3 1 18 / 50 Which Python keyword is used to handle exceptions? handle catch try 19 / 50 What does continue do in a loop? Skips the iteration Restarts the loop Exits the loop 20 / 50 How do you get the first character of a string? string[0:1] string.first() string[0] 21 / 50 What is the result of [1, 2, 3] + [4, 5]? [1, 2, 3] [5, 4, 3, 2, 1] [1, 2, 3, 4, 5] 22 / 50 Which operator is used to find the remainder of division? % // / 23 / 50 What is the result of "apple".find("z")? -1 None 0 24 / 50 How do you remove whitespace from the beginning and end of a string? strip() clean() strip(" ") 25 / 50 How do you get the remainder of a division? % divmod() // 26 / 50 What is the result of abs(-10)? 10 0 -10 27 / 50 What does break do in a loop? Exits the loop Skips an iteration Restarts the loop 28 / 50 What is the result of bin(10)? Binary 0b1010 1010 29 / 50 What is the result of range(3)? A tuple A range object A list 30 / 50 How do you call a function my_function in Python? my_function my_function() call my_function 31 / 50 What does the pop() method do in a list? Sorts the list Removes the last element Adds an element 32 / 50 How do you create a multi-line comment in Python? # " " ''' ''' 33 / 50 How do you split a string into a list? string.split() string.partition() split(string) 34 / 50 How do you delete a key-value pair in a dictionary? del dict[key] remove dict[key] pop dict[key] 35 / 50 What is the correct way to create a list in Python? {1, 2, 3} [1, 2, 3] (1, 2, 3) 36 / 50 How do you check if a key exists in a dictionary? key in dict key in dict.keys() dict.contains(key) 37 / 50 What is the result of len("Python")? 6 5 7 38 / 50 How do you start a comment in Python? * // # 39 / 50 What does str(123) return? A string An integer A float 40 / 50 How do you reverse a list in Python? list[::-1] list.reverse() reverse(list) 41 / 50 How do you check if a key exists in a dictionary? key in dict dict.has_key() dict.exist(key) 42 / 50 Which method is used to remove an item from a list? delete() erase() remove() 43 / 50 What is the result of "apple".upper()? APPLE Apple apple 44 / 50 What is the output of print(2 ** 3)? 6 8 9 45 / 50 What is the result of 5 * 2 == 10? False Error True 46 / 50 What is the output of len((1, 2, 3))? 2 3 4 47 / 50 What is the result of 10 // 3? 3 3.33 10 48 / 50 What is the output of bool(0)? 0 False True 49 / 50 Which keyword is used to check a condition in Python? if loop func 50 / 50 What is the result of "Python".find("o")? 3 4 -1 Your score is LinkedIn Facebook VKontakte 0% Exit