- 3
Using the `list()` function, write a statement that will create an empty list named `items`.
23 Respostas
+ 1
KarlTzy Bren your teacher is trolling youš. It's actually very sneaky. But here is a solution. Note the comma...š²
scores = list((False,)) * 100
print(scores)
The list function requires an iterable.
To create a one-item tuple of False, you need to write it like this:
(False,)
sneaky...
scores = list((False,)*100)
print(scores)
is another alternative answer that works.
+ 4
learning is not a race. If you can't do something, maybe it means you have not understood the previous lessons. Take your time, build a solid foundation
+ 3
Okay, then just do that?
If you need help, review the lesson and please show your code
+ 1
Then find output by doing a Python course on sololearn:
https://www.sololearn.com/Course/Python-for-Beginners/?ref=app
https://www.sololearn.com/Course/Python/?ref=app
+ 1
How are you planning to do the task without knowing how to create a list?
+ 1
Re-read your study materials. If you don't understand the basic concepts it is of no use to do advanced tasks.
If the task is too difficult for you now, do it later.
Instead of waiting for someone to give you ready-made code that you don't understand, revise the basics by doing some lessons in the sololearn course.
+ 1
The answer is literally IN THE TASK DESCRIPTION. šUse list() function
+ 1
It says it is named "items". READ THE TASK DESCRIPTION.
+ 1
In the time you spent trying to get others to do your homework for you, you could easily have figured out how to do this.
+ 1
Bob_Li š thank you so muchhhh š¤
0
learn by doing.
0
Actually I don't know how:<
0
what are variable names?
how to create a list?
0
Bob_li, It doesn't say what "variable names" and then "how to create a list" areš
0
That's all there is to it.
0
But this problem is not the same as the topic in your title. That one is simply
items = list()
It is on your other question. So it might be confusing to others..
- 1
because our teacher gave us a task without discussing it :<
- 1
I know the other question but the lasty I don't know how.
- 1
Can you help me? š
- 1
I'm not good at English š sorry for the wrong grammar :<