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 2 out of 6 pages
Exam (elaborations)

CNIT 155 MIDTERM QUESTIONS & ANSWERS

Document preview thumbnail
Preview 2 out of 6 pages

CNIT 155 MIDTERM QUESTIONS & ANSWERS

Content preview

CNIT 155 MIDTERM QUESTIONS & ANSWERS


The int function can be used to convert a string of digits into an integer. - Answers -
True

Any inputted data is considered string data, regardless of what the user inputted. -
Answers -True

Computers can create true random numbers - Answers -False

Boolean only has two possible values. - Answers -True

The if-else structure will always execute only one of the two actions. - Answers -True

What is the extension of the source file for a python program - Answers -.py

A logical operator determines whether a specific relationship exists between two values
- Answers -False

Which of the following correctly define string variable in python?

ProgrammerDialogue = 'Coding in python is fun!'
CNIT = *I am a CIT student.*
PurdueString = I attend Purdue University.
All of the above - Answers -ProgrammerDialogue = 'Coding in python is fun!'

IF is a legal python identifier - Answers -False

String can be used as a sequence in a for loop - Answers -True

Python needs a main function to operate - Answers -False

While loops are pretest loops - Answers -True

Syntax Errors occur when a program provides you with actual outputs that are different
from the desired outputs (The program runs but it gives the wrong results). - Answers -
False

sum_total is a legal python identifier - Answers -True

IN is a reserved word in Python - Answers -True

It is better to use elif over else to cover all the remaining cases in a chained if/elif. -
Answers -False

, The input function returns a Boolean if the user types in True - Answers -False

The expression (2 + * 3) results in an integer value - Answers -False

The ^ operator is the same as the ** operator in Python - Answers -False

In Python, the division operator (/) gives a float result, even if both of the numbers are
integers - Answers -True

If you enter a bunch of letters in response to the input function, the input function returns
a string. - Answers -True

What is the output of the following code?

n = 20
while (n <= 25):
print (n,"\n")
n = n + 1 - Answers -20, 21, 22, 23, 24, 25

The expression 3 ** 3 - ( 6 - 2 ) / 2 has the value _____. Is it an integer or a float value?
__________________.

7, int
25, float
7, float
25, int - Answers -25, float

What is max(3, 5, 1, 7, 4)? - Answers -7

What is printed by the last line of the following code:

x = 10
y = input("enter a letter: ")
print(y)

Assume the user enters the letter z in response to the prompt - Answers -z

What is printed by the last line of the following code:

x = 10
y = input("enter a letter: ")
print(y)

Assume the user enters the letter x in response to the prompt - Answers -nothing, an
error occurs

Document information

Uploaded on
January 24, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.49

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

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.
GEEKA
3.8
(360)
Sold
2132
Followers
1446
Items
57752
Last sold
2 hours ago



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