Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 41 pages
Exam (elaborations)

A STUDY GUIDE FOR D335 - INTRODUCTION TO PYTHON - (100) QUESTIONS WITH RADICLE RATIONALES

Document preview thumbnail
Preview 4 out of 41 pages

A STUDY GUIDE FOR D335 - INTRODUCTION TO PYTHON - (100) QUESTIONS WITH RADICLE RATIONALES IT & Cybersecurity Exam coverage: I. Section 1 (Q1-25): Python Basics — syntax, print(), input(), comments, variables, data types (int, float, str, bool), operators (+, -, *, /, //, %, **) . II. Section 2 (Q26-50): Control Flow & Functions — if/elif/else, for/while loops, range(), def functions, comparison operators, logical operators (and, or, not) . III. Section 3 (Q51-75): Data Structures — lists (append, pop, indexing), tuples, dictionaries (keys, values), sets, list/tuple/dict operations . IV. Section 4 (Q76-100): Advanced Topics — string methods (split, join, upper, lower, find, strip), file I/O (open, read, write), exceptions (try-except), type conversion, Boolean evaluation.

Content preview

Page 1 of 41


A STUDY GUIDE FOR D335 - INTRODUCTION TO
PYTHON - (100) QUESTIONS WITH RADICLE
RATIONALES
IT & Cybersecurity
Exam coverage:
I. Section 1 (Q1-25): Python Basics — syntax, print(), input(),
comments, variables, data types (int, float, str, bool),
operators (+, -, *, /, //, %, **) .
II. Section 2 (Q26-50): Control Flow & Functions — if/elif/else,
for/while loops, range(), def functions, comparison operators,
logical operators (and, or, not) .
III. Section 3 (Q51-75): Data Structures — lists (append, pop,
indexing), tuples, dictionaries (keys, values), sets,
list/tuple/dict operations .
IV. Section 4 (Q76-100): Advanced Topics — string methods
(split, join, upper, lower, find, strip), file I/O (open, read,
write), exceptions (try-except), type conversion, Boolean
evaluation.

1. In Python, which function is used to display output to the
console?
A) console.log()
B) printf()
C) System.out.println()
D) print() ✓ (CORRECT)

, Page 2 of 41


E) echo()
**RATIONALE:** The built-in print() function is the standard way
to display output in Python. The other options are syntax from
JavaScript (console.log), C (printf), Java (System.out.println),
and PHP (echo), respectively .




2. What is the correct syntax for a single-line comment in
Python?
A) // This is a comment
B) /* This is a comment /
C) # This is a comment ✓ (CORRECT)
D) <!-- This is a comment -->
E) ' This is a comment
**RATIONALE:** In Python, the hash symbol (#) denotes a
single-line comment. Everything after # on that line is ignored by
the interpreter. // is used in C++, Java, and JavaScript, while / */
is used for multi-line comments in those languages .




3. Which of the following is NOT a valid variable name in
Python?
A) my_variable
B) _private
C) 2nd_place
D) myVariable ✓ (CORRECT)
E) variable2
**RATIONALE:** Variable names in Python cannot start with a

, Page 3 of 41


digit. "2nd_place" starts with a number, making it invalid.
Variable names can start with a letter or underscore, followed
by letters, numbers, or underscores .




4. What is the data type of the value returned by the input()
function?
A) Integer
B) Float
C) String ✓ (CORRECT)
D) Boolean
E) List
**RATIONALE:** The input() function always returns a string. If
numeric operations are needed, explicit conversion using int()
or float() is required .




5. What is the output of print(type(3.14))?
A) <class 'int'>
B) <class 'float'> ✓ (CORRECT)
C) <class 'str'>
D) <class 'bool'>
E) <class 'complex'>
**RATIONALE:** The type() function returns the data type of the
argument. 3.14 contains a decimal point, making it a float
(floating-point number) in Python .

, Page 4 of 41


6. What is the output of print() in Python 3?
A) 3
B) 3.0
C) 3.3333333333333335 ✓ (CORRECT)
D) 3.33
E) 4
**RATIONALE:** In Python 3, the / operator always returns a
float, performing true division. The result of 10 divided by 3 is
approximately 3.3333333333333335 due to floating-point
representation .




7. What is the output of print(10 // 3)?
A) 3 ✓ (CORRECT)
B) 3.0
C) 3.3333333333333335
D) 4
E) 1
**RATIONALE:** The // operator performs floor division,
returning the integer quotient rounded down. 10 divided by 3
equals 3 with a remainder of 1, so floor division returns 3 .




8. What is the output of print(10 % 3)?
A) 1 ✓ (CORRECT)
B) 2
C) 3
D) 0

Document information

Uploaded on
August 15, 2026
Number of pages
41
Written in
2026/2027
Type
Exam (elaborations)
Contains
Unknown
$20.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
55
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions