+ 1

How to print python list - Can anyone help me solve the end of this code

https://code.sololearn.com/c95bc76Z3yql/?ref=app

14th May 2018, 12:05 AM
Nicolas MALET
Nicolas MALET - avatar
5 Antworten
+ 1
print(*fruit,sep='\n') try this...
14th May 2018, 5:43 AM
Suhail Ahmad
Suhail Ahmad - avatar
+ 1
print(list(enumarate(fruits))
19th May 2018, 9:22 AM
Nicolas MALET
Nicolas MALET - avatar
0
Thank you, but I wanted to display the index number followed by its value. For example 0 - banana 1 - pineapple
14th May 2018, 12:25 PM
Nicolas MALET
Nicolas MALET - avatar
0
who downvoted my code I think if u want to display the list called fruit it works fine
14th May 2018, 5:44 PM
Suhail Ahmad
Suhail Ahmad - avatar
0
thank you. it works but it doesn't return the index numbers. On the other hand, it is true that your code is super useful ;-)
14th May 2018, 5:54 PM
Nicolas MALET
Nicolas MALET - avatar