Categories
How to split text?
The user enters a command, for example 'make.dir' and you want the a variable to be equal to the text before the dot, and b after the dot.
Answer the question
In order to leave comments, you need to log in
a, b = input().split('.')
A more noobish version:
cmd = 'make.dir' a = cmd.split('.')[0] b = cmd.split('.')[1]
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question