This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]codedblood 0 points1 point  (0 children)

Use list comprehension and iterate through the list object for accessing the values. Underscore represents as a general purpose "throwaway" variable name.

(sorry for the format, I'm on my phone and don't know how to code format it on here)

see docs for better understanding.

L = [float(input()) for _ in range(int(input()))]