![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/1d99f7cb-50e7-4994-94c4-fd23f30209b7.png)
I know I’m being somewhat pedantic but range() returns an iterable range
type, not a list, in python 3.
I know I’m being somewhat pedantic but range() returns an iterable range
type, not a list, in python 3.
list.append
returns None
so what you’ve actually got is a list comprehension that generates a list containing the value None
19 times. (using functions with side effects, such as list.append
, in list comprehensions are generally bad style so you should avoid this)list[...]
syntax retrieves elements from the list, which is not what you’re trying to do here. (and it is actually invalid syntax in this case)list
, because list is already a builtin.If you want to append the numbers 1 to 19 to a list as you’re trying to do you can call the list.extend
function with the list comprehension [
as the argument. (Although in this case you can also just use the range directly.) To do it without list comprehensions you can simply loop over the range and repeatedly call the append function. ]
Ahh log cabin republicans, too republican for the gays, too gay for the republicans.
I’ve taken to listening to the Cobalt Core soundtrack, I never remember getting very far so I guess it works.
My favorite anecdote about Stallman is how some women at MIT kept massive amounts of plants in their office to ward him off.
In what way is it less effort than vim? I’ve tried helix a little bit and it didn’t seem that different.