Take multiple user inputs in a single line of code in Python.... #python #tips #shorts

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Interesting content, shame about the music. There's no need for it, especially so loud

jimbomonkey
Автор

you are taking only 1 input in second method..

CryptoBuilders
Автор

the first way is better if you don't enter 3 words separated by spaces then it errors. the best way would be to take the input into 1 variable and then test its length before making it 3 variables.

Gijy
Автор

If you are so obsessed with one liners why not use the walrus operator

codecompass
Автор

You're kidding me right? Well how do you expect you would get what you want exactly! You need 3 values in that one liner or you'll have a thrown error

rida_brahim
Автор

Well you could use a function having parameter *kwargs or **kwargs and each input should be passed on to it later use thode input from the function for x y z tasks or another's funtions from the function multipleinp

edudictivecoder
Автор

Great tutorial, but why the loud music? Can’t you play something more peaceful

poghuman
Автор

Wrong both have different out put. First method shows full name while second split the full name into first middle and last name.. my first name has space so in my case it would return wrong output while the first one would be correct...
You need more experience than just showing off split function

razathewanderer
Автор

What if the user inputs 4 words ? There's only 3 variables

GamerDevIND
Автор

You didnt account for people entering less or more than 3 words. Some people dont have a middle name. Some people only go by name. This will give error. Rather make list and unwrap using * or an iterator.

samarthrawat
Автор

This is a very bad practise unless you're unzipping valuses or assigning return variables.

florunio
welcome to shbcf.ru