Python map function question..

Asked 2 years ago, Updated 2 years ago, 58 views

I learned in Python that the map function is saved as a list. If so, I want to print out elements from the list created by the map function, but I get an error. Is there any other way I don't know?

num, a = map(int, input().split())
inp = map(int, input().split())
for i in range(1,num+1):
    Ifinf[i-1] < a: There is an error in the #inp part...
        print(a)

python map list

2022-09-20 19:14

1 Answers

inp = list(map(int, input().split()))

From Python3, the return type of map is not list.


2022-09-20 19:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.