if-else × + ks Library > CST 161 home> 4.3: Multiple if-else 2 Help/FAQ Gi Testi
ID: 3598794 • Letter: I
Question
if-else × + ks Library > CST 161 home> 4.3: Multiple if-else 2 Help/FAQ Gi Testing with year as 2100 Your output Distant future ACTwn 4.32 Multiple if statements: Printing car features Write multiple if statements. If car year is 1969 or earlier, print "Few safety features. If 1970 or later, print 'Probably has seat belts If 1990 or later, print Probably has anti-lock brakes. If 2000 or later, print Probably has air bags End each phrase with a period and a newline. Ex: car-year-1995 prints: Probably has seat belts. Probably has anti-lock brakes.Explanation / Answer
if car_year < 1970:
print("Few safety features.")
elif car_year < 1990:
print("Probably has seat belts.")
elif car_year < 2000:
print("Probably has anti-lock brakes.")
else:
print("Probably has air bags.")
# copy pastable code link: https://paste.ee/p/0PTrV
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.