[Tutor] stuck on null values

ADRIAN KELLY kellyadrian at hotmail.com
Thu Mar 15 22:24:21 CET 2012


Please can anyone tell me how to solve the problem i am having here, i am trying to loop if the value is left blank by the user but how can i then use the value and multiply it.  e.g. while number_child==""............ i want to multiply the input i get.........???
def main():    print """________________________________________________________
                Welcome to the Travel Kiosk________________________________________________________"""        adult=15    child=5    firstname=raw_input("Please enter your firstname: ")    lastname=raw_input ("Please enter your lastname: ")    number_child=raw_input("Enter the number of kids: ")    number_adults=raw_input("Enter the number of adults: ")    while number_child=="":        number_child=raw_input("Enter the number of kids: ")    price=child*number_child                print """_______________________________________________________
Thank you, the Price will be: """,price    print"""_______________________________________________________"""
main()
    

 

  

Adrian Kelly 
1 Bramble Close

Baylough

Athlone

County Westmeath

0879495663
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120315/47d9b96d/attachment.html>


More information about the Tutor mailing list