Python Question | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Python Question

Input = Qwerty/you/ui or any thing If I want to get 'ui' from input, how can I get it ?

2nd Sep 2020, 7:28 AM
Shubham Ingale
Shubham Ingale - avatar
4 Réponses
+ 2
Thanks Avalon
2nd Sep 2020, 7:53 AM
Shubham Ingale
Shubham Ingale - avatar
+ 1
No you are going wrong Web-Learner because I don't know that what will be length of "ui" it's only example
2nd Sep 2020, 7:46 AM
Shubham Ingale
Shubham Ingale - avatar
+ 1
print(input.split("/")[-1:])
2nd Sep 2020, 7:50 AM
Shadoff
Shadoff - avatar
+ 1
# Input Format Qwerty (Space) You (Space) UI txt=input() text=txt.split(' ') Qwerty=text[0] you=text[1] ui=text[2]
14th Oct 2021, 2:59 AM
Sancho Godinho
Sancho Godinho - avatar