100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
PYTHON exam(questions with 100% correct answers)(13) $14.99   Add to cart

Exam (elaborations)

PYTHON exam(questions with 100% correct answers)(13)

 4 views  0 purchase
  • Course
  • PYTHON
  • Institution
  • PYTHON

PYTHON exam(questions with 100% correct answers)(13)

Preview 2 out of 13  pages

  • October 17, 2024
  • 13
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • PYTHON
  • PYTHON
avatar-seller
Sakayobako30
PYTHON exam(questions with 100%
correct answers)(13)

The following code represents a ________________ if structure.



if a >= 1:

if a == 1: - correct answer ✔✔nested



Which line of code sets the value of the variable take_home to 500?

take_home == 1500 / (1 + 2)

take_home = 250 * + 2

take_home = 250 * (5 % 3)

take_home = 250 * 5 - 3 - correct answer ✔✔take_home = 250 * (5 % 3)



Given the code

message = "Your percentage score of "

percentage = "95.6"

letter_grade = "% is an A grade."



What is the correct code to display the following result?

Your percentage score of 95.6% is an A grade. - correct answer ✔✔print(message + percentage +
letter_grade)



Given the following parallel lists, which piece of code will print out each student and their major?



students = ["Jimmy", "Ravi", "Lauren"]

majors = ["Accounting", "Finance", "ISA"] - correct answer ✔✔for i,student in enumerate(students):

print(student + ", Major: " + majors[i])

, What will be displayed by the following code?

age = 18

score = 550

income = 60000

if age >= 20 or (score > 600 and income > 50000):

print("approved")

elif age > 18 and age < 20:

print("approved with condition")

else:

print("not approved") - correct answer ✔✔not approved



The while keyword takes a condition just like which other keyword? - correct answer ✔✔if



Which of the following is a valid variable name in Python?:



1st place

None of these answers

1st_place

and - correct answer ✔✔None of these answers



What is printed by the following program?



my_total = 0

do_not_stop = True

while do_not_stop == True:

my_total += 5

if my_total > 10:

do_not_stop = False

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Sakayobako30. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83249 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.99
  • (0)
  Add to cart