Notes
![]() ![]() Notes - notes.io |
#traffic light color. There is red, green, and yellow.
#Write an IF-ELSE statement that is going to display a
#message for each color that the user enters. Display a
#simple error message if the user enters anything other than
#the three colors.
color = input("What color is the traffic light")
if(color == 'red'):
print("Stop")
else:
if(color == 'green'):
print('Go')
else:
if(color == 'yellow'):
print('Slow')
else:
print('ERROR')
#Write a program that is going to serve as a temperature
#conveter (Celsius to Fahrenheit). Begin by asking the user
#to enter a degree number in Celsius. Then use the formula
#for converting Celsisus to Fahrenheit to convert the value.
#Display a message telling the user what value they entered.
#If the converted temperature is anywhere between 68 and 72 degrees,
#display a message saying that it is room temperature. Anything above that,
#display a message saying it is too hot. Anything above that,
#display it is too cold
celsius = float(input("Enter temperature in celsius: "))
fahrenheit = (celsius * 9/5) + 32
print('%.2f Fahrenheit is: %0.2f Celsius' %(fahrenheit, celsius))
if(68 >= fahrenheit >= 72):
print('Room Temperature')
elif(fahrenheit > 72):
print('too hot')
elif(fahrenheit < 62):
print('too cold')
#Johnny is going on vacation to Jamaica. However, he wants to save money
#at the airport by not spending extra money exceeding the suitcase weight
#limit. Johnny already bought his ticket for $400 and he does not
#want to spend any money becasue he is on a budget. The suitcase weight cannot
#exceed 25 pounds. If it exceeds 25 pounds, Johnny has to pay an extra $30.
#Write a program that is going to help Johnny before he reaches the airport.
suit_case = input("What is the weight of the suitcase:")
if(suit_case > '25'):
print('Pay 30$')
else:
print('Its fine')
#Write a simple program that will calculate the letter grade
#a student got in his/her biology class based on the number average that
#they have in the class. Remember A is 100-90, B is 89-80, C is 79-70,
#D is 69-65 and F is anything below a 64.
grade = int(input("What is the grade"))
if(grade >= 90):
print("You have an A")
else:("You have a B")
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team