eldara5
July 24th, 2007, 01:00 AM
Can anyone please tell me whats wrong here, the error is at the bottum part of creating rerun() function
#! user/bin/python
#
print #Just for a space
### Creating a new function to rerun the program
def rerun():
a = raw_input('Would you like to restart the program? ')
while a == 'yes':
print 'Would you like to lookup a user or add one?,'
start = raw_input('Type lookup or add: ') # wait for the user
if start == 'add':
print
name = raw_input("Type the first name: ")
print
lname = raw_input('Type the last name: ')
print
age = raw_input('Type the age: ')
print
address = raw_input('What is his/her address ? ')
print
Telephone = raw_input('Whats his/her telephone number ? ')
print
print 'Ok, This is what you gave me'
print
print 'the name is', name, lname,
print
print 'they are ', age, 'years old',
print
print 'they live at', address,
print
print 'And there number is', Telephone,
print
well = raw_input('is this ok? ')
if well == 'yes':
print
print 'Storing Data Now'
else:
print
print 'Why did you put it in wrong???? /n Well im a nice program so i wont save your mistake but now you have to start again'
print 'Program Created by Eldara'
a = raw_intput('Would you like to restart the program? ')
else: ##ERROR IS HERE <--------------------------------------------
print "Exiting Program Now...."
else: #What happens if they try to lookup
print 'not yet available'
print
print 'Program Created by Eldara'
rerun()
###Program Begins##
print 'Hello, Welcome to Infoscript, i am a basic program (The first of my masters) and i would like to thank you for using me'
print
print 'Would you like to lookup a user or add one?,'
start = raw_input('Type lookup or add: ') # wait for the user #User inputs what they want
if start == 'add': #If they want to add a new user
print
name = raw_input("Type the first name: ")
print
lname = raw_input('Type the last name: ')
print
age = raw_input('Type the age: ')
print
address = raw_input('What is his/her address ? ')
print
Telephone = raw_input('Whats his/her telephone number ? ')
print
print 'Ok, This is what you gave me'
print
print 'the name is', name, lname,
print
print 'they are ', age, 'years old',
print
print 'they live at', address,
print
print 'And there number is', Telephone,
print
well = raw_input('is this ok? ')
if well == 'yes':
print the
print 'Storing Data Now'
rerun() #rerun function from above
else:
print
print 'Why did you put it in wrong???? /n Well im a nice program so i wont save your mistake but now you have to start again'
print 'Program Created by Eldara'
rerun() #rerun function from above
else: #What happens if they try to lookup
print 'not yet available'
print
print 'Program Created by Eldara'
rerun()
If i take that line out it runs fine but it is needed or people cannot leave the script
Thanks in Advance,
Eldara
#! user/bin/python
#
print #Just for a space
### Creating a new function to rerun the program
def rerun():
a = raw_input('Would you like to restart the program? ')
while a == 'yes':
print 'Would you like to lookup a user or add one?,'
start = raw_input('Type lookup or add: ') # wait for the user
if start == 'add':
name = raw_input("Type the first name: ")
lname = raw_input('Type the last name: ')
age = raw_input('Type the age: ')
address = raw_input('What is his/her address ? ')
Telephone = raw_input('Whats his/her telephone number ? ')
print 'Ok, This is what you gave me'
print 'the name is', name, lname,
print 'they are ', age, 'years old',
print 'they live at', address,
print 'And there number is', Telephone,
well = raw_input('is this ok? ')
if well == 'yes':
print 'Storing Data Now'
else:
print 'Why did you put it in wrong???? /n Well im a nice program so i wont save your mistake but now you have to start again'
print 'Program Created by Eldara'
a = raw_intput('Would you like to restart the program? ')
else: ##ERROR IS HERE <--------------------------------------------
print "Exiting Program Now...."
else: #What happens if they try to lookup
print 'not yet available'
print 'Program Created by Eldara'
rerun()
###Program Begins##
print 'Hello, Welcome to Infoscript, i am a basic program (The first of my masters) and i would like to thank you for using me'
print 'Would you like to lookup a user or add one?,'
start = raw_input('Type lookup or add: ') # wait for the user #User inputs what they want
if start == 'add': #If they want to add a new user
name = raw_input("Type the first name: ")
lname = raw_input('Type the last name: ')
age = raw_input('Type the age: ')
address = raw_input('What is his/her address ? ')
Telephone = raw_input('Whats his/her telephone number ? ')
print 'Ok, This is what you gave me'
print 'the name is', name, lname,
print 'they are ', age, 'years old',
print 'they live at', address,
print 'And there number is', Telephone,
well = raw_input('is this ok? ')
if well == 'yes':
print the
print 'Storing Data Now'
rerun() #rerun function from above
else:
print 'Why did you put it in wrong???? /n Well im a nice program so i wont save your mistake but now you have to start again'
print 'Program Created by Eldara'
rerun() #rerun function from above
else: #What happens if they try to lookup
print 'not yet available'
print 'Program Created by Eldara'
rerun()
If i take that line out it runs fine but it is needed or people cannot leave the script
Thanks in Advance,
Eldara