Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
clarified notes
Browse files Browse the repository at this point in the history
  • Loading branch information
carpben committed Jul 26, 2015
1 parent e7aa610 commit 88bc6d3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions fizzbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
print "Welcome to the Fizzbuzz Game!"

# defining n.
# first option command line argument. command line can have: 1 argument (no n), 2 arguments (n) or more than 2 arguments (mistake/error)
# In case of 2 arguments, the second argument is n. otherwise n will be equal to user's input.
# first option command line argument. command line can have: 0 argument (no n), 1 arguments (n) or more than 1 arguments (mistake/error)
# In case of 1 arguments, the second argument is n. otherwise we will ask user to provide input (n).
#possible problems: argument or input should be an integer in type string. If that is not the case than we have a problem.
# we are instructed to handel error.
# it will arise when we try to convert from type string to type integer.
Expand All @@ -17,12 +17,7 @@
n=int(n)
break
except Exception, e:
#while (type(n)==int)==False:
n=raw_input ("Please enter a number. We will play Fizzbuzz up to the number you choose. ")
#try:
# n=int(n)
# except Exception, e:
# pass
n=raw_input ("Please enter a number of type integer. ")

# printing fizzbuzz up to n
print "Fizz buzz counting up to {}".format (n)
Expand All @@ -35,5 +30,4 @@
print("Fizz")
else:
print(num)



0 comments on commit 88bc6d3

Please sign in to comment.