Question bank

Filter questions by subject, topic and difficulty. Open any question to answer it and see the explanation.

Clear
255 questions found · practise this subject as a set Show 20 · 50 per page
#QuestionSubject and topicDifficulty
81 Which of the following is a web browser? Computer Science/Informatics Practices
Web browsers
Easy
82 A small text file stored by a website on a user's computer to remember preferences is called a Computer Science/Informatics Practices
Web browsers
Easy
83 A user installs a small program in the browser that blocks advertisements on all websites. This program is be… Computer Science/Informatics Practices
Web browsers
Medium
84 Which statement about incognito (private) browsing is correct? Computer Science/Informatics Practices
Web browsers
Medium
85 Why are third-party cookies considered a privacy risk? Computer Science/Informatics Practices
Web browsers
Hard
86 Which exception is raised by int('abc')? Computer Science/Informatics Practices
Exceptions
Easy
87 When does Python report a syntax error such as a missing colon after an if condition? Computer Science/Informatics Practices
Exceptions
Easy
88 Which exception occurs when the code x = [1, 2, 3] is followed by print(x[5])? Computer Science/Informatics Practices
Exceptions
Medium
89 What happens when the statement assert 2 > 3, "check failed" is executed? Computer Science/Informatics Practices
Exceptions
Medium
90 Which is the correct way to define and raise a user-defined exception in Python? Computer Science/Informatics Practices
Exceptions
Hard
91 Which block runs whether or not an exception occurs in the try block? Computer Science/Informatics Practices
try, except, else and finally
Easy
92 When is the else block of a try statement executed? Computer Science/Informatics Practices
try, except, else and finally
Easy
93 A try block contains print(5/0); it is followed by except ZeroDivisionError: print("Z"), else: print("E") and… Computer Science/Informatics Practices
try, except, else and finally
Medium
94 A try block contains x = int("12"); it is followed by except ValueError: print("V"), else: print("E", x) and … Computer Science/Informatics Practices
try, except, else and finally
Medium
95 A function has try: return "T" followed by finally: print("F"). What is printed when print(f()) is executed? Computer Science/Informatics Practices
try, except, else and finally
Hard
96 Which mode opens a text file for adding data at the end without erasing existing content? Computer Science/Informatics Practices
Text files
Easy
97 What does the readlines() method return? Computer Science/Informatics Practices
Text files
Easy
98 A file contains the text PYTHON PROGRAM. After f = open(...) in read mode, s = f.read(6) is executed. What is… Computer Science/Informatics Practices
Text files
Medium
99 For the same file containing PYTHON PROGRAM, f.seek(7) is followed by print(f.read(3)). What is printed? Computer Science/Informatics Practices
Text files
Medium
100 A file has lines one, two and three. It is opened with 'w' mode, f.write("x") is executed and the file is clo… Computer Science/Informatics Practices
Text files
Hard