Difference between revisions of "Geek Flow Chart Assignment"
From WLCS
Line 1: | Line 1: | ||
'''Objective:''' Create a program that asks the user various questions that leads them through the [[Image:GeekDatingChart.jpg]] | '''Objective:''' Create a program that asks the user various questions that leads them through the [[Image:GeekDatingChart.jpg]] | ||
+ | |||
+ | '''Procecures:''' | ||
+ | # Create a python script named geekDating.py | ||
+ | # Ask the user the first question: "Do you have someone in mind? (y/n)" | ||
+ | # Store the user's input into a variable | ||
+ | # If the variable is a "y", then proceed to ask them "Are they available? (y/n)" | ||
+ | # If the variable is a "n", then proceed to "GPF" | ||
+ | # HINT: You will have NESTED if statements as you proceed through the geek dating chart. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <source lang="python"> | ||
+ | choice = raw_input("Have you eaten yet today? (y/n)") | ||
+ | |||
+ | if choice == "y": | ||
+ | print "You ate without me?" | ||
+ | if choice == "n": | ||
+ | choice = raw_input("Would you like to get some Five Guys? (y/n)") | ||
+ | if choice == "y": | ||
+ | print "YES! Five Guys rocks!" | ||
+ | else: | ||
+ | print "WHAT?!? You are crazy! Five Guys rocks!" | ||
+ | </source> |
Revision as of 14:12, 8 October 2008
Objective: Create a program that asks the user various questions that leads them through the
Procecures:
- Create a python script named geekDating.py
- Ask the user the first question: "Do you have someone in mind? (y/n)"
- Store the user's input into a variable
- If the variable is a "y", then proceed to ask them "Are they available? (y/n)"
- If the variable is a "n", then proceed to "GPF"
- HINT: You will have NESTED if statements as you proceed through the geek dating chart.
Example:
choice = raw_input("Have you eaten yet today? (y/n)")
if choice == "y":
print "You ate without me?"
if choice == "n":
choice = raw_input("Would you like to get some Five Guys? (y/n)")
if choice == "y":
print "YES! Five Guys rocks!"
else:
print "WHAT?!? You are crazy! Five Guys rocks!"