How to get a List from user in 1 Line? | Python

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

This video explains how to get a List as user input in Python in just one Line of Code using List Comprehension. The Step by Step explanation is given in the video.

list_name=[datatype(iteration_variable) for iteration_variable in input("Message").split(",") ]

When you run, give the inputs separated by comma. If you want the inputs to be processed as integer inputs, type int for datatype. If you have floating values, mention float as datatype. If you want string values, you need not mention the datatype. The examples in the video explain how to get string and int inputs.

Wish you a time of Happy Learning with the Last Minute Professor!😇

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

I have been searching for this from past 2 days, and finally found it here . Thank you so much for sharing this amazing information .

sirshofahim
Автор

Fabulous!
I had been looking for this for a very long time!
God bless!

babakazizi
Автор

guys please share this such a great channel is not getting many subscribers....
your teaching style is very good

themadmystery
Автор

This was so helpful! Thank you so much for this video!

lilizhao
Автор

Very helpful, thanks - was looking for how to do this

bacardibreezer
Автор

Very helpful video.. thank you so so much

tamannaafrin
welcome to shbcf.ru