Jan-12-2020, 04:21 PM
(Jan-12-2020, 03:43 PM)Armin Wrote: Thanks for your reply what bothers me most about this code is line 7 this part y = [i for i in input ('give me a number:') i know this is list comprehensions but i don't understand it how this line of code number 7 works ??
[i for i in input('give me a number: ').split(',')]
number_string = input('give me a number: ') # "1, 2, 3" numbers = number_string.split(',') #[1, 2, 3]It's really overkill
input('give me a number: ').split(',')Is functionally equivalent