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 default value of end in a print() function? "," "n" "." 2 / 50 What is the result of "Python".find("o")? 3 4 -1 3 / 50 What is the result of 10 // 3? 3.33 3 3 4 / 50 How do you sort a dictionary by its keys? dict.sort() dict.sortkeys() sorted(dict) 5 / 50 What is the result of max([1, 5, 3])? 3 5 1 6 / 50 What is the result of bool("False")? True None False 7 / 50 How do you create an infinite loop in Python? repeat forever while True: for True: 8 / 50 Which Python keyword is used to handle exceptions? catch handle try 9 / 50 How do you access the value of a key in a dictionary? dict.value(key) key.dict() dict[key] 10 / 50 What is the output of 10 / 3? 3 3.333... 3 11 / 50 What is the result of round(2.5)? 2 2 3 12 / 50 What is the result of "abc".upper()? Abc ABC abc 13 / 50 What is the result of "apple".upper()? Apple APPLE apple 14 / 50 What is the output of print(2 ** 3)? 6 9 8 15 / 50 How do you check if a key exists in a dictionary? key in dict key in dict.keys() dict.contains(key) 16 / 50 How do you get the length of a list? len(list) count(list) size(list) 17 / 50 What does continue do in a loop? Restarts the loop Skips the iteration Exits the loop 18 / 50 What keyword is used to define a loop in Python? repeat iterate for 19 / 50 What does is compare in Python? Object identities Memory usage Values only 20 / 50 How do you iterate over a range in steps of 2? range(0, 10) range(0, 10, 2) range(2, step=2) 21 / 50 What is the result of 5 in [1, 2, 3, 4, 5]? False True None 22 / 50 What is the output of 10 == 10? False True Error 23 / 50 Which operator is used for equality comparison? === == = 24 / 50 Which method is used to remove an item from a list? erase() delete() remove() 25 / 50 What is the output of len({1, 2, 2, 3})? 3 5 4 26 / 50 What is the output of print(type(10))? <class 'int'> <class 'str'> <class 'float'> 27 / 50 How do you handle exceptions in Python? try-except if-else handle 28 / 50 What is the output of bool([])? True None False 29 / 50 How do you add an element to a list? list.append() list.add() list.appendlist() 30 / 50 How do you start a function with optional arguments? def func(a): def func(a=1): def func(a: int): 31 / 50 How do you convert a list into a set? set(list) list.set() list.unique() 32 / 50 How do you access an element by key in a dictionary? dict["key"] dict.key dict.get("key") 33 / 50 What is the result of 3 > 5 or 5 > 2? None True False 34 / 50 How do you call a function my_function in Python? my_function my_function() call my_function 35 / 50 What does x += 1 mean? x = x - 1 x = x + 1 x = x / 1 36 / 50 Which method adds an element to the end of a list? append() add() push() 37 / 50 What is the result of 10 != 5? Error False True 38 / 50 Which keyword is used to check for membership in a list? in in_list contains 39 / 50 What is the output of len([1, 2, 3, 4])? 4 3 5 40 / 50 What does type([]) return? <class 'list'> <class 'dict'> <class 'tuple'> 41 / 50 How do you check if a string contains only numbers? str.onlydigits() isdigit() str.isdigit() 42 / 50 How do you import a module in Python? use math module import math import math 43 / 50 How do you join elements of a list into a string? combine(list) concat(list) "".join(list) 44 / 50 How do you convert a list to a set in Python? list(set) set(list) {list} 45 / 50 What is the output of not(True)? True False None 46 / 50 What is the result of 3 > 1 and 4 > 5? False True None 47 / 50 How do you raise a number to a power? pow(num, power) num^power num**power 48 / 50 What is the output of "hello".count("l")? 3 1 2 49 / 50 What is the output of "Hello" + "World"? HelloWorld Hello World Error 50 / 50 What is the output of list("hello")? ['hello'] ('h', 'e', 'l', 'l', 'o') ['h', 'e', 'l', 'l', 'o'] Your score is LinkedIn Facebook VKontakte 0% Exit