Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts
Amazon Auto Links: No products found.
Okay I’ve found the spelling error in append
if we do
players =palyers +[1,2,3,4,5,6]
then the result is same and if we ask to print players then it will print the whole.Whats the use of using append function
Instead of using append(), all I did was redefine players using the concatenation (+ sign) like this: players = players + [1, 4, 18, etc]
I literally thought about Crosby Malkin and Letang 5 seconds before you said it
“.append” is for adding one number only. How can I add more than one number to the list?
So, lists are like arrays?
Wanna ask is the term list in python not an array in other languages? I’m kinda confused since in c# list is something else.
The visibility of your tutorial would be improved enormously if you could, you know, increase the font size?
Are these lists or arrays? In most programming languages I know (which is not a lot that’s why I’m asking) list has a lot to do with poiters or refereces. Here I cant see that connection but maby there is one that you just didn’t mention.
Why can’t I use this list also with words ? like
list = [cherry, apple, orange]
list [2] ?
How can I select a word ?
>>> players“, line 1, in
(1, 2, 3, 4, 5)
>>> players[2]
3
>>> players[2] = 9
Traceback (most recent call last):
File “
players[2] = 9
TypeError: ‘tuple’ object does not support item assignment
>>>
Why am i getting this error and not to you? lol confused
# creating a array using loop
l = [ ]
for index in range(0, 20, 2):
l.append(index)
print (l)
In this case it is better to use append() instead +=
len[user]“, line 1, in
Traceback (most recent call last):
File “
len[user]
TypeError: ‘builtin_function_or_method’ object is not subscriptable
While using append function we can add only 1 entry.But what we should do when we need to add multiple entries..
player.apend
YOu can also just do players = [] to clear the list
I can’t see the words, it’s too small
Does .append command work in Python 3.6.1. Shell? When I gave command, it gave me the following error –
Traceback (most recent call last):“, line 1, in
File “
players.append[120]
TypeError: ‘builtin_function_or_method’ object is not subscriptable
how to write a list of characters?
Hi Bucky, isnt it possible to use an function for appending multiple character, secondly is there any way to append a character in a particular part of the string/list rather than at the last.
Hey some problem here
>>> hello [ 1,2,3,4,5,6,7]“, line 1, in
>>> hello[3]
>>> 4
>>> hello[5]
Traceback (most call last):
File “
hello [4]
IndexError : list index out of range
Help me please!!!
wet it up and throw it in a bag lol
I’m using Python 2.7 so instead of using + use += (+= means it equals it’s old value + the new value), -= also works
Thanks for the, its been helpful. If i want to update (append) the players list by more than one variable (numbers), how do I go about that (4:12)?
Penguins!