Python

Python syntax, libraries, scripting, and general-purpose programming.

01

Quizzes

10

Questions

00

eBooks

00

Articles

00

Likes

119

Views

00

Shares

Python

QUESTION NO 01
Share
Which statement handles exceptions?

Answer: try / except
Python uses try/except (and optionally else/finally).
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 02
Share
__init__ is used to?

Answer: Initialize a new object instance
The constructor method runs when an instance is created.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 03
Share
len("hello") returns?

Answer: 5
The string "hello" has 5 characters.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 04
Share
Tuples differ from lists mainly because tuples are?

Answer: Immutable
Once created, tuple elements cannot be reassigned.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 05
Share
How do you start a comment in Python?

Answer: #
Single-line comments begin with #.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 06
Share
dict in Python stores?

Answer: Key–value pairs
Dictionaries map keys to values with average O(1) lookup.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 07
Share
Python is known as a?

Answer: Interpreted, high-level language
Python is high-level and typically executed by an interpreter/VM.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 08
Share
Which keyword defines a function in Python?

Answer: def
Functions are declared with def name(...):
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 09
Share
Python lists are?

Answer: Mutable ordered sequences
Lists can grow/shrink and hold mixed types; order is preserved.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 10
Share
PEP 8 is?

Answer: Python style guide
PEP 8 documents idiomatic Python formatting and naming.
302 Quizzes
2930 Questions
00 Likes