Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

years = 2 months = 5 days = 2 4 #You may modify the lines of code above, but don't move them! #When you Submit

years =2
months =5
days =24
#You may modify the lines of code above, but don't move them!
#When you Submit your code, we'll change these lines to
#assign different values to the variables.
#Ever been at a loss for what to do for your significant
#other for Valentine's Day? Let's right some code to generate
#a gift recommendation!
#
#The variables above give the length of the relationship in
#number of years, months, and days. Add some code below to
#print a gift recommendation based on these values:
#
# - If you've been dating for at least 4 years, give them a
# dog ("dog").
# - If you've been dating for at least 1 year but less than
# 4 years, give them a watch ("watch").
# - If you've been dating for at least 6 months but less than
# 1 year, give them concert tickets ("concert tickets").
# - If you've been dating for at least a day but less than 6
# months, give them candy ("candy").
# - If aren't actually dating, go big or go home: give them
# a yacht to sail away together ("yacht").
#
#Note that no matter what, you should only print one gift.
#Add your code here!
if years 4 :
print ("dog")
elif years 1 :
print ("watch")
elif months 6 :
print("concert tickets")
elif days >=1 and months 6:
print ("candy")
else:
print("yacht")
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logidata+ Deductive Databases With Complex Objects Lncs 701

Authors: Paolo Atzeni

1st Edition

354056974X, 978-3540569749

More Books

Students also viewed these Databases questions