Question: Snippet A def get _ ticket _ price ( ) - > int: age: int = int ( input ( What is your age?

Snippet A
def get_ticket_price()-> int:
age: int = int(input("What is your age?"))
if age <=12:
price: int =5
else:
price: int =10
return price
Snippet B
def get_ticket_price()-> int:
age: int = int(input("What is your age?"))
if age <=12:
price: int =5
elif age >60:
price: int =5
else:
price: int =10
return price
Snippet C
def get_ticket_price()-> int:
age: int = int(input("What is your age?"))
if (age <=12) or (age >60):
price: int =5
else:
price: int =10
return price
Snippet D
def get_ticket_price()-> int:
age: int = int(input("What is your age?"))
if age <=12:
price: int =5
elif age <=60:
price: int =10
return price
Select the two snippets that result in the same value for price given any input.
Choice 1 of 4: Snippet A
Choice 2 of 4: Snippet B
Choice 3 of 4: Snippet C
Choice 4 of 4: Snippet D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!