tut no. 10, magic number

+1 x hoss · February 18, 2015

this works, range in 100

output = 90
for n in range(100):
    if n is output:
        print(n, "is the winning output!")
        break
    else:
        print(n)



this does not work, range is 1000

output = 900

for n in range(1000):
    if n is output:
        print(n, "is the winning output!")
        break
    else:
        print(n)



when range is 1000 and output is less than 257 only then this code executes well.
whats wrong in this ?

Post a Reply

Replies

Oldest  Newest  Rating
0 x hoss · February 19, 2015
yea thanx
but did not got this logic 

:silly:
  • 1

Python

106,960 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator