Little problem, argv[x] is always a string, never an int.

This commit is contained in:
Deathsbreed 2015-01-27 09:11:37 -06:00
parent 4ef76a1855
commit e4617f480b

View File

@ -92,14 +92,14 @@ elif sys.argv[1] == "-v":
print "CoinToss", version
sys.exit(0)
if sys.argv[1] is not int:
print "Please give an integer."
sys.exit(0)
printCopyright()
# Create necessary variables
trials = int(sys.argv[1])
try:
trials = int(sys.argv[1])
except ValueError:
print "Please give an integer."
sys.exit(2)
heads = 0
tails = 0