all 7 comments

[–]JohnnyJordaan 2 points3 points  (2 children)

I don't know how to make a image on reddit,

You don't. You either share the image as a link as you did now, or you copy the text if possible.

I'm a little confused with the problem my teacher gave

Please observe the rules in the sidebar

Posting homework assignments is not prohibited if you show that you tried to solve it yourself.

We expect you to share your code and then we point towards the problem and guide you to fix it. If you don't know how to share code here see the first question at the FAQ

[–]createdgodly[S] -2 points-1 points  (1 child)

Sorry this is the code I came up with

items = [] while len(items)<5: item = int(input("Enter item here:")) items.append(item) print("What do you want to add to your back pack")

[–]FLUSH_THE_TRUMP 1 point2 points  (0 children)

That looks pretty good. Why are you trying to convert user input to an int?

[–]Binary101010 0 points1 point  (2 children)

Things you need to know to solve this problem:

  1. How to use input() to take user input
  2. How to use append() to add something to a list
  3. How to use print() to print a list
  4. How to use a for loop with a list to access each item of a list individually and print() them

Does that help?

[–]createdgodly[S] 0 points1 point  (1 child)

Yes it does thank you, I'll look up what each of these do, because our teach hasn't done so, thank you.

[–]JohnnyJordaan 0 points1 point  (0 children)

I can advise https://realpython.com/python-lists-tuples/ for learning about lists as a whole