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 "Python"[::-1]? nohtyP Error Python 2 / 50 What is the result of bool([1, 2])? None True False 3 / 50 How do you create a tuple in Python? (1, 2, 3) {1, 2, 3} [1, 2, 3] 4 / 50 What is the result of 10 != 5? False True Error 5 / 50 How do you split a string into a list? string.split() split(string) string.partition() 6 / 50 What is the output of 10 == 10? False Error True 7 / 50 How do you write a multi-line string in Python? " " ' ' """ """ 8 / 50 How do you convert a string to an integer? convert(string) int(string) str(int) 9 / 50 What is the result of 5 in [1, 2, 3, 4, 5]? None True False 10 / 50 Which operator is used for equality comparison? = === == 11 / 50 What is the default value of end in a print() function? "," "n" "." 12 / 50 How do you join elements of a list into a string? concat(list) combine(list) "".join(list) 13 / 50 How do you create a multi-line comment in Python? # ''' ''' " " 14 / 50 Which method adds an element to the end of a list? append() add() push() 15 / 50 What is the output of len((1, 2, 3))? 4 3 2 16 / 50 What is the result of round(2.5)? 2 2 3 17 / 50 What is the output of bool(None)? False Error True 18 / 50 How do you handle exceptions in Python? if-else try-except try-catch 19 / 50 Which keyword is used to check for membership in a list? in_list contains in 20 / 50 How do you create a lambda function in Python? function(x): x + 1 lambda x: x + 1 lambda x -> x + 1 21 / 50 How do you get the length of a list? len(list) size(list) count(list) 22 / 50 How do you find the index of an element in a list? index() locate() find() 23 / 50 How do you get the length of a dictionary? len(dict) count(dict) len(list) 24 / 50 How do you round 2.675 to two decimal places? round(2.675, 2) 2.68 round() 25 / 50 How do you swap two variables in Python? temp=var1; var1=var2; var2=temp var1, var2 = var2, var1 var1 = var2; var2 = var1 26 / 50 What is the result of "Python".find("o")? 3 -1 4 27 / 50 How do you handle exceptions in Python? handle try-except if-else 28 / 50 What is the result of len("Pythonn")? 7 6 8 29 / 50 What is the result of float(10)? 10 Error 10 30 / 50 How do you get the remainder of a division? divmod() % // 31 / 50 What is the result of 10 // 3? 10 3 3.33 32 / 50 What does isinstance("Python", str) return? None False True 33 / 50 How do you add an element to a list? list.append() list.appendlist() list.add() 34 / 50 What is the result of bool("False")? False None True 35 / 50 What is the output of "hello".count("l")? 1 2 3 36 / 50 What is the result of bool("")? False True None 37 / 50 What does str(123) return? A string A float An integer 38 / 50 How do you call a function my_function in Python? call my_function my_function my_function() 39 / 50 What is the correct file extension for Python files? .pyth .pt .py 40 / 50 What is the default return value of a function in Python? None 0 Error 41 / 50 How do you define a function in Python? function func() def func(): def func() 42 / 50 How do you create a single-line string in Python? '''Hello''' "Hello" """Hello""" 43 / 50 How do you open a file in write mode? open("file", "r") open("file", "w") open("file") 44 / 50 How do you create a dictionary in Python? {} dict() [] 45 / 50 What does isinstance(x, int) check? If x is defined If x is an integer If x is a string 46 / 50 What is the result of 3 > 5 or 5 > 2? False True None 47 / 50 What is the result of "Python" * 2? PythonPython Error PythonPython 48 / 50 What is the output of print(2 ** 3)? 8 9 6 49 / 50 How do you convert a list into a set? list.set() set(list) list.unique() 50 / 50 What is the output of print(type(10))? <class 'int'> <class 'str'> <class 'float'> Your score is LinkedIn Facebook VKontakte 0% Exit