Respuesta :
Following are the python program to calculate discount by input age value:
Program Explanation:
- Defining two-variable "passengerName and ageString" that uses an input method to inputs string value init.
- In the next step, another variable "passengerAge" is declared that uses an int method to convert "ageString" value into an integer.
- After converting the string into integer a conditional statement is used that check age value is between 6 to 65, and use print method to print message.
Program:
passengerName=input("Enter passenger's name: ")#Defining a variable passengerAge that inputs sting value
ageString=input("Enter passenger's age: ")#Defining a variable ageString that inputs string value
passengerAge=int(ageString)#defining a variable passengerAge that converts string into integer value
if passengerAge<=6 or passengerAge >=65:#use if that checks passenger age in between 6 to 65
print("passenger is eligible for a discount of 25%")#print message
else:#else block
print("passenger is not eligible for a discount of 25%")#print message
Output:
Please find the attached file.
Learn more:
brainly.com/question/6503092
