0
Can anyone tell how can we write a code in python which includes (print input and loop) all in one line?
4 Antworten
+ 1
print([x for x in input() if x == 'a'])
you can read about list comprehension if you want other examples
+ 1
for char in input():print(char)
0
Thanks you all