Range | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Range

when i print this num=list(range(3,8)) print(num) print(range(20)==(0,20)) i get [3,4,5,6,7] False but why is it False it should be True or am i missing something?

14th Feb 2017, 12:44 PM
Naschkatzification
Naschkatzification - avatar
3 Answers
+ 1
(0,20) is not range(0,20)
14th Feb 2017, 12:48 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
True i tried x=list(range(20)) y=list(range(0,20)) if y==x: print(True) and it worked I should have read correctly ty for your answer
14th Feb 2017, 1:22 PM
Naschkatzification
Naschkatzification - avatar
+ 1
my pleasure :)
14th Feb 2017, 6:03 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar