May-05-2018, 05:06 PM
Hey guys, I am very new to Python and messing around with some coding. I am trying to create an Information Program which prints out the information provided in a sentence if you want. I have an issue though, the part in which the user decides if they want the information in a sentence doesn't seem to work. Any help will be appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#Information about you print ( ''' Welcome to the Information Program! ''' ) first_name = input ( 'What is your First Name?' ) print ( 'Your first name is %s. ' % first_name) surname = input ( 'What is your Surname?' ) print ( 'Your Surname is %s. ' % surname) print ( 'So, your full name is %s %s ' % (first_name,surname)) dob = input ( 'What is your Date of Birth?' ) print ( 'Your date of birth is %s. ' % dob) birth_place = input ( 'Where were you born?' ) print ( 'You were born in %s. ' % birth_place) def decision(): decision1 = input ( ''' Do you want your Full Information? Type Y for YES or N for NO. ''' ) if decision1.upper() = = 'Y' : print ( ''' Your Full name is %s %s, you were born on the %s, and born in %s. ''' % (first_name, surname, dob, birth_place)) elif decision1.upper() = = 'N' : print ( 'Okay, thank you for using the Information Program!' ) else : print ( 'You have typed in an invalid answer, please run the program again.' ) |