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 5 pages
Exam (elaborations)

Conditinols in python codehs- Test Questions & Answers

Document preview thumbnail
Preview 2 out of 5 pages

Conditinols in python codehs- Test Questions & Answers

Content preview

Conditinols in python codehs- Test
Questions & Answers
4.1.4: Fix This Program ✔️Correct Ans-brought_food = True

brought_drink = False

print(brought_food)

print(brought_drink)

# These lines don't work! Fix them so that they do.

print(type ("Did the person bring food? " + str(brought_food)))

print(type ("Did the person bring a drink? " + str(brought_drink)))



4.1.5: Plants ✔️Correct Ans-needs_water = True

needs_to_be_repotted = False

print("Needs water: " + str(needs_water))

print (str(needs_to_be_repotted))

print(needs_water)



4.2.5: Fix This Program ✔️Correct Ans-can_juggle = True

# The code below has problems. See if

# you can fix them!

if can_juggle:

print("I can juggle!")

, else:

print("I can't juggle.")



4.2.6: Is It Raining? ✔️Correct Ans-




4.3.6: Old Enough to Vote? ✔️Correct Ans-your_age = int(input("How old are you?: "))

age_requirement= 18

can_vote = your_age >= age_requirement

if can_vote:

print("old enough to vote")

else:

print("not old enough to vote")



4.3.7: Positive, Zero, or Negetive ✔️Correct Ans-random_number = int(input("Enter a number:
"))

if random_number < 0:

print("That number is negative!")

elif random_number > 0:

print("That number is positive!")

else:

print("That number is zero!")

Document information

Uploaded on
January 31, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$8.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.
KeithAndrews
3.0
(28)
Sold
128
Followers
5
Items
14564
Last sold
2 days 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