I need to print a list in Python nicely and numbered. For example, if this is my list:
list = ["hello", "dad", "milk"]
this is the output I want:
[1] -hello
[2] -dad
[3] -milk
This is what I have tried:
list = ["hello", "dad", "milk"]
list_element = 0
stuff = len(list)
while stuff != list_element:
element = list[list_element]
print(f"[{list_element}] -{element}")
list_element = list_element + 1
and this is the output I get:
[0] -hello
[1] -dad
[2] -milk
but I don't know how to make it start from 1 (I know in programming you start with 0, but I want to start with 1!)
edit: I forgot to mention this was homework and we didn't learn about the for loop yet so my teacher said I shouldn't use it as to not confuse my classmates lol