python questions You are considering a new game to buy. Write a piece of code th
ID: 3836743 • Letter: P
Question
python questions
You are considering a new game to buy. Write a piece of code that accepts two values from the user, the rating of the game and the average cost (in dollars). You should print console output about how interested you are in that game; print either very interested, sort-of interested, or not interested based on the following criteria: You like bargains. Any game that is less than $10.00 and rated at least 3.5 stars interests you a lot. You dislike expensive games. You don't want to play any game that costs more than $65.00 unless it is also rated 5 stars. Even then you are only sort-of interested. You like quality. You are very interested in any game that is 4.5 stars or better and costs less than $50.00. You are sort of interested in any game that is rated 3.0-4.4 stars and costs $10.00-$50.00. You are not interested in any other type ofExplanation / Answer
rating = input('Enter rating of game: ') #Taking Rating from the user
cost = input('Enter average cost in dollars ') #Taking Cost from the user
if (cost < 10.00) and (rating >= 3.5): #If else condition
print("Very intersted")
elif (cost < 50.00) and (rating >= 4.5):
print("Very intersted")
elif cost >= 10.00 and cost <= 50.00 and rating >= 3.0 and rating <= 4.4 :
print("sort of intersted")
elif (cost > 65.00) and (rating == 5.0):
print("sort of intersted")
else:
print "Not intersted"
Output:
Enter rating of game:
4.2
Enter average cost in dollars
45.25
sort of intersted
sh-4.3$ python main.py
Enter rating of game:
2
Enter average cost in dollars
45
Not intersted
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.