0

Can anyone tell how can we write a code in python which includes (print input and loop) all in one line?

7th Sep 2020, 10:40 PM
Parteek Yadav
4 odpowiedzi
+ 1
print([x for x in input() if x == 'a']) you can read about list comprehension if you want other examples
7th Sep 2020, 11:04 PM
Ruba Kh
Ruba Kh - avatar
+ 1
for char in input():print(char)
7th Sep 2020, 11:08 PM
Thống Nguyễn
Thống Nguyễn - avatar
0
Thanks you all
9th Sep 2020, 6:19 AM
Parteek Yadav