Skip to content

Instantly share code, notes, and snippets.

@nadia2012
Created February 22, 2012 00:47
Show Gist options
  • Save nadia2012/1880254 to your computer and use it in GitHub Desktop.
Save nadia2012/1880254 to your computer and use it in GitHub Desktop.
class ex
nadia al-otaibi 208115517
wjood al-ajmi 208217252
#Create a program that continuously runs asking the user for his name
# Show a customized greeting message after the user enters his name
x=1
while x==1:
name = raw_input("what is your name?")
print "hello " ,name , "Answer the questions following pleas "
last_name = raw_input("What is your last name?")
age = raw_input("How old are you?")
x=1+1
# Can you think of other way to improve this program?
if age > 18 :
print "u are allowed to enter the programe " ,name
else:
print "not allowed to enter the program"
# greeting messages pecific for certain first names
if name == "nadia":
print "hello student " ,name
elif name == "hessa":
print " hello Eng " ,name
elif name == "mohammed":
print "hello DR " , name
else:
print "welcome to the program " ,name
#Either randomly from a list
names=[ "sara" , "reem" ,"noor"]
for z in names :
print "good mornning %s " % z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment