Dear Sirs and Madem , I started phoyton last night with thenewboston but I didn't understand list video because he taught use players but when I studied try with fruits gave error what did I do wrong here
I cannot understand your question. What is “thenewboston”? What is “list video”? What is “use players”? What is “try with fruits”? What error did you get?
Also, please try to be more careful with your typing.
</> code format button for code not for your questions. Try to spell words correctly, “Python” not Phyton or phoyton.
Thenewbostpn is a youtuber. List video his content on youtube he tought how to made list on phtyon his example players = [ 12, 23, 34,]
But I want try like this fruits = [ banana, melon, kiwi] but this line is wrong
Probably you need quotes. Without quote the word
banana is a reference
to a variable named
banana. You probably want this:
fruits = [ "banana", "melon", "kiwi" ]
which makes a list containing 3 strings and binds it to the
I don’t really see how the specific YouTube tutorial you were watching is relevant, but if you want a list like that, what you want is a list of strings. Strings are enclosed in quote marks. So you would want
fruits = ['banana', 'melon', 'kiwi']
Perhaps thenewboston has a video on strings you could watch to learn about them? The error here has nothing to do with lists specifically.
I’m pretty new to this stuff, I’m just trying to understand the logic and trying what I can think of, thank you very much for helping me.
I strongly suggest that you read the first 5 chapters of The Python Tutorial — Python 3.11.2 documentation in order and then watch beginner videos in whatever order. Notice that lists are in chapter 5, meaning that they assume some previous knowledge.