Skip to content

Instantly share code, notes, and snippets.

@cybnz
Created July 30, 2020 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cybnz/7fdaff522879770fb3403791d755b2b6 to your computer and use it in GitHub Desktop.
Save cybnz/7fdaff522879770fb3403791d755b2b6 to your computer and use it in GitHub Desktop.
Checks for blanks but allows numbers
# Get's recipe and checks it is not blank
# Not Blank Function goes here
def not_blank(question):
valid = False
while not valid:
response = input(question)
if response == "":
continue
else:
return response
# Main Routine goes here
recipe_name = not_blank("What is the recipe name? ")
print("You are making {}".format(recipe_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment