Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Homework
#1
Hi,I have a homework question: Write a program that will ask for a favorite genre (type) of music, and then make a recommendation.
I have attempted it below but i don't know what went wrong.

pop=int(input("Do you like pop music?"))
alternative=int(input("Do you like alternative music?"))
indie=int(input("Do you like indie rock music?"))
soul=int(input("Do you like soul music?"))
if pop==yes:
    print("Nirvana")
elif alternative==yes:
    print("Cults")
if indie==yes:
    print("Arctic Monkeys")
elif soul==yes:
    print("The Jackson 5")
came out with this:

Error:
Traceback (most recent call last): File "main.py", line 1, in <module> pop=int(input("Do you like pop music?")) ValueError: invalid literal for int() with base 10: 'yes'
Reply


Messages In This Thread
Homework - by chickenseizuresalad - Oct-09-2021, 11:49 AM
RE: Homework - by ndc85430 - Oct-09-2021, 12:30 PM
RE: Homework - by chickenseizuresalad - Oct-09-2021, 01:00 PM
RE: Homework - by ndc85430 - Oct-09-2021, 01:04 PM
RE: Homework - by DeaD_EyE - Oct-09-2021, 02:09 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020