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 Coding Problem 3.2.1 le relationship in
#number of years, months, allu uays. muu 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 :
else:
print ("candy")
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

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

Examine the role of identification in the behavior change process.

Answered: 1 week ago