[Solved] I have just started learning super basic Python this week. Look at my basic code for entry ticket in a park [closed]


Hi i am also new in Python but as i understand

1- age = "\t\n\tWhat is your age\t\n\t\t\t"
2- input(age)
3- age= int(age)

you can change as below

age = int(input("\t\n\tWhat is your age\t\n\t\t\t"))
  1. line means age is a string which containt this data
  2. read console and set to age variable
  3. try to convert to int and set as same variable

string can carry multi type variable so should be carryfully.

BTW:

  1. for gender ‘f’ and ‘F’ is different for python you can add OR condition.
  2. try and catch is good for converting data

2

solved I have just started learning super basic Python this week. Look at my basic code for entry ticket in a park [closed]