❓ Help Pa help po python

Python:
light_color = input("What is the color of the traffic light? (red, yellow, or green) ").lower()

if light_color == 'red':
    action = "Stop"
elif light_color == 'yellow':
    action = "Slow down and prepare to stop"
elif light_color == 'green':
    action = "Go ahead"
else:
    action = "Invalid color - please enter red, yellow, or green."

print(f"The light is {light_color}. You should: {action}")
 
Python:
light_color = input("What is the color of the traffic light? (red, yellow, or green) ").lower()

if light_color == 'red':
    action = "Stop"
elif light_color == 'yellow':
    action = "Slow down and prepare to stop"
elif light_color == 'green':
    action = "Go ahead"
else:
    action = "Invalid color - please enter red, yellow, or green."

print(f"The light is {light_color}. You should: {action}")
thank you so much poooooo
 

Attachments

  • 20240321_093448.webp
    20240321_093448.webp
    70.5 KB · Views: 26
hello pooo penge pa nga po isa para sa classmate ko something about time ginagawa niya e
isa pang unique ?

eto ohh parang mini vendo

Python:
print("Welcome to the Python Vending Machine! Here are your choices:")
print("1: Chips")
print("2: Chocolate")
print("3: Soda")
print("4: Candy")

choice = input("Please enter the number of your choice: ")

if choice == '1':
    result = "You have selected Chips. Dispensing..."
elif choice == '2':
    result = "You have selected Chocolate. Dispensing..."
elif choice == '3':
    result = "You have selected Soda. Dispensing..."
elif choice == '4':
    result = "You have selected Candy. Dispensing..."
else:
    result = "Invalid selection. Please choose a number between 1 and 4."
print(result)
 

About this Thread

  • 27
    Replies
  • 1K
    Views
  • 4
    Participants
Last reply from:
Phseeker

Trending Topics

Online now

Members online
1,012
Guests online
880
Total visitors
1,892

Forum statistics

Threads
2,274,666
Posts
28,957,428
Members
1,233,395
Latest member
mikmik012218
Back
Top