Skip to content

Instantly share code, notes, and snippets.

@danhyun
Created August 27, 2014 21:12
Show Gist options
  • Select an option

  • Save danhyun/b15fba758f0add6a8ae9 to your computer and use it in GitHub Desktop.

Select an option

Save danhyun/b15fba758f0add6a8ae9 to your computer and use it in GitHub Desktop.
keep printing numbers as long as it is not 0
prompt = "Give me a number: "
i = input(prompt)
while i:
print "You entered %s whose square is %s" % (i, i * i)
i = input(prompt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment