• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

CS 170 || with A+ Guaranteed Solutions.

Document preview thumbnail
Preview 2 out of 9 pages

What is the result of evaluating 7%2 ? correct answers 1 What is the output from the following program, assuming that the user enters the input value 5. def main(): n = eval(input("Enter a number: ")) ans=0 for x in range(1,n): ans = ans + x print(ans) correct answers none of the above 5: 10 Identifiers in Python may not contain correct answers spaces Suppose a program executes the following statement. value = eval(input("Enter a number: ")) In response to the prompt, the user types 5 + 5. What is the result? correct answers value contains 10 The fragment of code eval(input("Enter a number: ")) is best described as: correct answers an expression that returns the result of evaluating what the user types What Python statement allows the math library to be used in a program? correct answers import math What is the result of evaluating list(range(1,7,2)) ? correct answers none of the above [1,3,5] What is the result of evaluating 3 + 4.0 correct answers 7.0 Fragments of code that produce new data values are called correct answers expressions The goal of the specification phase of the software development process is correct answers to determine what the program should do Suppose that the variable x has the value 5 and y has the value 10. After executing this statement: x,y = y,x what will the values of x and y be, respectively? correct answers 10 and 5 When a Python int gets "too large" it correct answers requires more memory to store What is the output from the following code fragment: fact=1 for factor in range(5): fact = fact * factor

Content preview

CS 170 || with A+ Guaranteed Solutions.
What is the result of evaluating 7%2 ? correct answers 1

What is the output from the following program, assuming that the user enters the input value 5.
def main():
n = eval(input("Enter a number: "))
ans=0 for x in range(1,n):
ans = ans + x
print(ans) correct answers none of the above
5: 10

Identifiers in Python may not contain correct answers spaces

Suppose a program executes the following statement.
value = eval(input("Enter a number: "))
In response to the prompt, the user types 5 + 5. What is the result? correct answers value contains
10

The fragment of code eval(input("Enter a number: ")) is best described as: correct answers an
expression that returns the result of evaluating what the user types

What Python statement allows the math library to be used in a program? correct answers import
math

What is the result of evaluating list(range(1,7,2)) ? correct answers none of the above
[1,3,5]

What is the result of evaluating 3 + 4.0 correct answers 7.0

Fragments of code that produce new data values are called correct answers expressions

The goal of the specification phase of the software development process is correct answers to
determine what the program should do

Suppose that the variable x has the value 5 and y has the value 10. After executing this
statement:
x,y = y,x
what will the values of x and y be, respectively? correct answers 10 and 5

When a Python int gets "too large" it correct answers requires more memory to store

What is the output from the following code fragment:
fact=1
for factor in range(5):
fact = fact * factor

, print(fact) correct answers 0

Which of the following is a correct Python expression for converting temperatures from Celsius
to Fahrenheit? correct answers fahrenheit = (9/5) * celsius + 32

Suppose that the variable x has the value 5 and y has the value 10. After executing these
statements: correct answers 10 and 10

Which of the following is a counted loop that executes 5 times? correct answers for i in range(5):

Which of the following is not an example of a function from the Python math library? correct
answers abs(x)

What is the result of evaluating 7//2 ? correct answers 3

The goal of the design phase of the software development process is correct answers to create an
algorithm that solves the problem

Suppose that the variable x currently has the value 20. What statement would cause the value of
x to become 25? correct answers x = x+5

The program pattern IPO stands for correct answers input process output

Consider the following program:def main():
num = eval(input("Enter a number: "))
for i in range(5):
num = num // 2
print(num)
main() if you entered in 1024 correct answers 32

What is the output from the following program fragment?
for i in [1,3,5,7]:
print(2 * i, end=" ") correct answers 2 6 10 14

What is the result of evaluating the expression list(range(5)) ? correct answers [0, 1, 2, 3, 4]

The Python reserved word for performing output to the screen is correct answers print

Magnetic or optical media are generally used for: correct answers secondary memory

The Python numeric type that can represent positive and negative whole numbers is correct
answers int

Python identifiers must start with a letter or underscore. correct answers

Document information

Uploaded on
March 25, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.79

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.
SirAnton
3.7
(118)
Sold
811
Followers
438
Items
40316
Last sold
1 week 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