100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Python Coding Exam-Questions With 100% Verified Answers.

Rating
-
Sold
-
Pages
27
Grade
A+
Uploaded on
30-04-2025
Written in
2024/2025

Python Coding Exam-Questions With 100% Verified Answers.

Institution
Python
Module
Python










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Python
Module
Python

Document information

Uploaded on
April 30, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Python Coding Exam-Questions With 100%
Verified Answers.
What Python statement would you like me to run? - ✔✔(Chapter 1) When Python is running
in the interactive mode and displaying the chevron prompt (>>>) - what question is Python
asking you?


20 - ✔✔(Chapter 1) What will the following program print out:


>>> x = 15
>>> x = x + 5
>>> print x


.py - ✔✔(Chapter 1) Python scripts (files) have names that end with:



for - ✔✔(Chapter 1) Which of these words is a reserved word in Python ?



quit() - ✔✔(Chapter 1) What is the proper way to say "good-bye" to Python?



Central Processing Unit - ✔✔(Chapter 1) Which of the parts of a computer actually execute
the program instructions?


A sequence of instructions in a programming language - ✔✔(Chapter 1) What is "code" in the
context of this course?


Secondary Memory - ✔✔(Chapter 1) A USB memory stick is an example of which of the
following components of computer architecture?


The computer did not understand the statement that you entered - ✔✔(Chapter 1) What is the
best way to think about a "Syntax Error" while programming?

,Random steps - ✔✔(Chapter 1) Which of the following is not one of the programming
patterns covered in Chapter 1?


# This is a test - ✔✔(Chapter 2) Which of the following is a comment in Python?



123abc - ✔✔(Chapter 2) What does the following code print out?



hours - ✔✔(Chapter 2) Which of the following variables is the "most mnemonic"?



stop - ✔✔(Chapter 2) Which of the following variables is the "most mnemonic"?



Retrieve the current value for x, add two to it and put the sum back into x - ✔✔(Chapter 2)
What does the following statement do? x = x + 2


Parenthesis () - ✔✔(Chapter 2) Which of the following elements of a mathematical expression
in Python is evaluated first?


2 - ✔✔(Chapter 2) What is the value of the following expression? 42 % 10



5 - ✔✔(Chapter 2) What is the value in x after the following statement executes: x = 1 + 2 * 3
-8/4


98 - ✔✔(Chapter 2) What value be in the variable x when the following statement is
executed?
x = int(98.6)


Pause the program and read data from the user - ✔✔(Chapter 2) What does the Python
raw_input() function do?

, Indent the line below the if statement - ✔✔(Chapter 3)
What do we do to a Python statement that is immediately after an if statement to indicate that the
statement is to be executed only when the if statement is true?


= - ✔✔(Chapter 3) Which of these operators is not a comparison / logical operator?


Depending on the value of x, either all three of the print statements will execute or none of the
statements will execute - ✔✔(Chapter 3)What is true about the following code segment:
if x == 5 :
print 'Is 5'
print 'Is Still 5'
print 'Third 5'


You de-indent the next line past the if block to the same level of indent as the original if
statement - ✔✔(Chapter 3) When you have multiple lines in an if block, how do you indicate
the end of the if block?


You have most likely mixed tabs and spaces in the file - ✔✔(Chapter 3)
You look at the following text:
if x == 6 :
print 'Is 6'
print 'Is Still 6'
print 'Third 6'
It looks perfect but Python is giving you an 'Indentation Error' on the second print statement.
What is the most likely reason?


except - ✔✔(Chapter 3) What is the Python reserved word that we use in two-way if tests to
indicate the block of code that is to be executed if the logical test is false?

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
KenAli West Virginia University
Follow You need to be logged in order to follow users or courses
Sold
84
Member since
1 year
Number of followers
5
Documents
17177
Last sold
6 days ago

2.9

19 reviews

5
4
4
4
3
4
2
0
1
7

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions