learning python. Is this the true power of python?
for i in range(len(array)):
#kill me
print(i)
learning python. Is this the true power of python?
for i in range(len(array)):
#kill me
print(i)
amount = 0
for braincell in ops.head():
i += 1
# prints 0 still, why?
print(amount)
for i, _ in enumerate(array):
print(i)
for i in array:
print(i)
Rewritten in Haskell
haskell
show array
whats the problem retard?
OP wanted to print all the indexes in the array though, not the values.
for i in 0..array.len() {
println!("{}", i);
}
dilate
seething
*drinking
If you're struggling with Python you're going to love C++
>tfw superior nippon ranguage
puts array.each_index.to_a
array.iter().inspect(|v| println!("{}", v)).collect::();
array.iter().for_each(|v| println!("{}", v));
FTFY
nice
no, this is confusing a variable that counts how many items there are in your array (which you already had with len(array)) and printing the first value of the item, which would be print(array[i][0]) with your terminology
Oh, my bad.
show [0.. len array - 1]
for i in arrary:
print(i) #god user is so dumb holy shit I hope he gets better
Well, you could also use
for i in list:
print(list.index(i))
but that's going to be slow for large lists.
Oh, and it'll also fuck up if your list contains a value several times.
print([i for i in len(array)])
len inside range, sry
.say for @array.keys
let _ = arr.enumerated().forEach { print($0.0) }
what the reason for getting rid of
for (i = 0; i < len(array); i++)
There are no semicolons on python
Wtf is this disgusting syntax? Kys
for i, _ in enumerate(array):
print(i)
Jesus what embarrassment in this thread.
What exactly is your problem here?