+ 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)
+ 3
s = input().split()
print(s)
# -1 line
+ 2
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?
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
2 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes