+ 2
Lists
How I can convert a Input with several words to a useful list without splitting up the words in letters?
4 Answers
0
In Python, you can use the split() function. By default, it detects whitespaces on a string to split it into a list.
sentence = input()
words = sentence.split()
print(words)
+ 4
s = input().split()
print(s)
# -1 line
+ 3
s = ['Solo','Learn','!!!']
# N:1
for i in s:
print(i, end='')
#N:2
print(''.join(s))
#N:3
âŠ..
0
What did you mean with a useful list? useful for what?