0
why in first sentence ,lenth is 3 but print it out if content is 0,3 ?
numbers =range(3) print(len(numbers)) print(numbers) print("-----") numbers = list(range(10)) print(len(numbers)) print(numbers) print("-----") numbers = 1,2,3,4 print(len(numbers)) print(numbers) print("-----")
2 Answers
+ 7
ćłćźć
##why in first sentence ,lenth is 3 but print it out if content is 0,3 ?
## Because your range you preset as 3
numbers =range(3)
print(len(numbers))
print(numbers)
print("-----")
## Here you prest your list range as 10
numbers = list(range(10))
print(len(numbers))
print(numbers)
print("-----")
## Here you defined numbers as a set of 4
numbers = 1,2,3,4
print(len(numbers))
print(numbers)
print("-----")
0
BroFar
##why in first sentence ,lenth is 3 but print it out if content is 0,3 ?
#yes,I knew it, i define volume of numbers as 3 ,
From my concept ,it should be [0,1,2], but print (numbers) is [0,3]
## Because your range you preset as 3
numbers =range(3)
print(len(numbers))
print(numbers)
print("-----")