How do I split an input | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

How do I split an input

28th Feb 2020, 10:53 PM
DrPaid329
2 ответов
+ 1
in Python: Split a string into a list where each word is a list item: txt = input( ) or "Welcome to Hello World!" x = txt. split() print(x) may be a shoter: x = input( ).split( ) You can specify the separator, default separator is any whitespace. syntax: string.split(separator, maxsplit) maxsplit - Specifies how many splits to do.
28th Feb 2020, 11:27 PM
Vitaly Sokol
Vitaly Sokol - avatar
0
In what language?
28th Feb 2020, 11:06 PM
Austin