PYTHON Practice Questions

Topics Covered : Core fundamentals, practicals, and concepts

50 Questions Available

Question 1

What is a constructor method called in Python?

A __init__
B __construct__
C __start__
D __main__

Question 2

Which mode is used to open a file for writing, overwriting its contents?

A w
B a
C x
D r

Question 3

Which mode is used to open a file for appending data to the end?

A w
B a
C x
D r

Question 4

How do you indicate a block of code in Python?

A Brackets
B Curly braces
C Indentation
D Parentheses

Question 5

Which list method removes an element at a specific index?

A remove()
B delete()
C pop()
D discard()
Reduportal — Footer