User Input For List | Python Programs

  Рет қаралды 107,558

Amulya's Academy

Amulya's Academy

Күн бұрын

In this Python Programming video series we will discuss about how to take user input for list in detail.
Here we will see how we can take user input for list using for loop while loop and also how to input different type of input to list.
#PythonPrograms #List
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy

Пікірлер: 135
@salahuddinkhan8120
@salahuddinkhan8120 3 жыл бұрын
The Easiest and the most clear explaination I've seen on youtube. Tysm
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@nmtamil4774
@nmtamil4774 Ай бұрын
Please do comeback mam​@@AmulsAcademy
@3delhelal
@3delhelal 3 жыл бұрын
I really want to thank you, I am from Egypt, and I am not good at understanding most English accents and I wanted to understand a certain part of a module, and I did not see such an easy way of explaining or a clear voice like you, thank you Amulya ♥️
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
You're very welcome! :)
@nicolledenipitiya7567
@nicolledenipitiya7567 2 жыл бұрын
It really helped me Thank you so much !!!
@ranadeepsaha9696
@ranadeepsaha9696 3 жыл бұрын
Good morning Maam. Thanks for your modules. Loop was not cleared to me before your explanation. I am getting confident in the loop. You are doing a great job. I got stuck with the below when inputting any string showing errors. import ast list =[] while True: a = ast.literal_eval(input('Enter the items')) list.append(a) y = input('Would you like to continue entering numbers? press any key for yes and n for no') if y=='n': break print(list) Thank you very much for your lessons.
@kumodsharma7235
@kumodsharma7235 2 жыл бұрын
Wow , Thanku mam for this beautiful explanation all doubts is cleared in a single tutorial video
@xNatheeeGamer
@xNatheeeGamer Жыл бұрын
Thanks Amulya, you're a legend!
@maliknagi1064
@maliknagi1064 Жыл бұрын
Thank you very much for this amazing tutorial now I can do some cool stuff after fully understanding the while and for loops... again Thank you very much.
@GhostDcuo
@GhostDcuo 2 жыл бұрын
Hey, great tutorial thanks for the upload. I've been struggling with this all day but i finally get it lol, and thanks again.
@drakslayer6972
@drakslayer6972 3 жыл бұрын
Thank you for your effort and clear explanation. This helps me so much at python
@Kitchen24000
@Kitchen24000 3 жыл бұрын
Amulya shetty good one again
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@NachoNC320
@NachoNC320 3 жыл бұрын
Muchas gracias por ayudarme Amulya si no era por ti, seguiria renegando con las listas. Te agradezco de corazon.
@oodlesofawe
@oodlesofawe 2 жыл бұрын
Thanks a lot!!!
@AmitSingh-ty5hw
@AmitSingh-ty5hw 2 жыл бұрын
amazing video
@Inte8ranD
@Inte8ranD Ай бұрын
Thanks, amulyia.
@RaviKumar-cr7qc
@RaviKumar-cr7qc 3 жыл бұрын
good teaching and easly understandig, in for loop in empty list
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@AnkitSingh-vj6dz
@AnkitSingh-vj6dz 2 жыл бұрын
Thank you ma'am
@htbgamer4548
@htbgamer4548 3 жыл бұрын
hello from us, thank u:)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure 😊
@pranavh_shaurya_tej
@pranavh_shaurya_tej 3 жыл бұрын
I got headache to make a list by user. I found the solution by this video. Thank you❤️
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure :)
@francismannion7075
@francismannion7075 4 ай бұрын
That was great , thank you.
@alimanager
@alimanager 3 жыл бұрын
It indeed helped me in understanding control on user inputs. Thanks.
@apurbadebnath4342
@apurbadebnath4342 2 жыл бұрын
Very good explanation
@joyprokash4013
@joyprokash4013 Жыл бұрын
Thank you so much. Please provide us Data Science courses also mam.
@parthasarathejay.7957
@parthasarathejay.7957 3 жыл бұрын
Thank you so much, sis. Saved my life!
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
😊😊😊
@priyanshusharma2144
@priyanshusharma2144 3 жыл бұрын
How she saved your life 🤔🤔
@parthasarathejay.7957
@parthasarathejay.7957 3 жыл бұрын
@@priyanshusharma2144 Was nearing a deadline, and was panicking since everything was unfamiliar. Amulya explained everything in a crystal clear way, which made me picked up everything in minutes. I recommend you watch her tutorials if you have any interest. Really a lifesaver.
@priyanshusharma2144
@priyanshusharma2144 3 жыл бұрын
Ohk but how she helps you, menas now what are you doing have get your placement
@parthasarathejay.7957
@parthasarathejay.7957 3 жыл бұрын
@@priyanshusharma2144 I didn't quite get you. 😅
@paramasivaanand
@paramasivaanand 2 жыл бұрын
Thanks for the great explanation. It really helped me on understanding the full flow.
@theunknownWitsom
@theunknownWitsom 2 жыл бұрын
Thank you for the help! Very concise video explanation
@MRCRAZY-wm4ln
@MRCRAZY-wm4ln 3 жыл бұрын
thanks maam for such a nice lesson.... congo for 101k.... keep making such videos, thank you once again
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you so much :)
@myerwerl
@myerwerl 2 жыл бұрын
What if i dont want to know how many, because i want to print the length of the imputs from the user? For instace, add a number, do you want to add more (y/n). Then it will loop back. If i press n, then i will have a series of fucntions.
@azadnagar3929
@azadnagar3929 3 жыл бұрын
Really nice voice and helpful concept
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@J35513gORaYa
@J35513gORaYa 2 жыл бұрын
How do u do this with a space bar ends input , when i do this loop it adds a number to a list once [4] then the rest show up like 4
@RuhulAmin-hg6lj
@RuhulAmin-hg6lj 3 жыл бұрын
this class is helpful but we can do it in another way a=input("enter your numbers") s=a.split() print(s) i think it will be helpful too
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
👍🏻
@hazyhaul5720
@hazyhaul5720 3 жыл бұрын
You are the best sweat heart... Thanks
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@hazyhaul5720
@hazyhaul5720 3 жыл бұрын
Your explain well, you can help summarise GUI and py to exe
@subasreev5189
@subasreev5189 3 жыл бұрын
It really helped me Thank you so much
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure :)
@MiaTheDreamer
@MiaTheDreamer 2 жыл бұрын
Thanks loads..
@CouldbeSample
@CouldbeSample 3 жыл бұрын
hug thanks from Brazil dud
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@urbanevolutionlifestyle6209
@urbanevolutionlifestyle6209 2 жыл бұрын
Thank you
@theme6865
@theme6865 Жыл бұрын
thank u❤❤❤❤❤❤
@sumitchandora1183
@sumitchandora1183 3 жыл бұрын
Best videos :)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@mamillasrihari5791
@mamillasrihari5791 Жыл бұрын
How to give heterogeneous input for list in single line from user end?
@pinkytrivedi5665
@pinkytrivedi5665 3 жыл бұрын
We can use eval in input :)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Yes :)
@shivanshugour4975
@shivanshugour4975 3 жыл бұрын
for chuck yen times ok mam got it
@sivasu07
@sivasu07 3 жыл бұрын
Asusual 👌👍
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@31.pratikkaranjule35
@31.pratikkaranjule35 2 жыл бұрын
while executing some programs on online compiler why it shows EOFError.While same program is running on another compiler.Why this could happen?
@ajkoh
@ajkoh Жыл бұрын
Hey, if i want the user to have the choice to remove something from the list aswell, how do i do that?
@feziwezimu931
@feziwezimu931 3 жыл бұрын
thanks, mam for the lesson but how do you use that code then add it up?
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
I didn’t get you ..
@apurbadebnath4342
@apurbadebnath4342 2 жыл бұрын
You are boss
@zakjay6748
@zakjay6748 3 жыл бұрын
Hiii!, love it. what if i want different commands from same user_input symbol? like if user_input press "yes" it will give one clue, if user input give "yes" for the second time then it will give 2nd clue in the print. How can I do that? I am stuck :(
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
You can use loop :)
@tquadtechno7472
@tquadtechno7472 4 ай бұрын
COMMENDABLE. Could not be better
@arpit8720
@arpit8720 Жыл бұрын
@DhruvGoyaI
@DhruvGoyaI 2 жыл бұрын
I am typing lst = [] it is giving syntax error please tell why ?
@mantoshkumar8661
@mantoshkumar8661 2 жыл бұрын
But I didn't get error
@prageetgames
@prageetgames 2 жыл бұрын
what if i have to find the maximum value from a multiple user inputs what will be the code?
@apekshitdhoke
@apekshitdhoke 3 жыл бұрын
Let's suppose list has 2 only two options. I want user to select either option 1 or 2 as input and then proceed with my program to gather more import input from user then how should I go about it?
@sahukarisidhivinayaka2093
@sahukarisidhivinayaka2093 2 жыл бұрын
But in this type of user input all the elements in the list will be of same type..........but according to definition of list it can contain the elements of multiple types......how can we take input in which our list contain elements of multiple types
@stoggy3451
@stoggy3451 2 жыл бұрын
Yeah, but what do I do if the program isn't supposed to ask for a value on how many times it is supposed to run. I know I would use a while loop obviously but how do I know when to break the loop!
@universal4334
@universal4334 3 жыл бұрын
Do the same for indepth about lambda , map
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Sure :)
@SJ-ic4yr
@SJ-ic4yr 3 жыл бұрын
n=int(input(“Enter number of elements : “)) Lst=[int(input(“Enter element : “)) for x in range(0,n)] Will this work?
@irenechelsia1160
@irenechelsia1160 3 жыл бұрын
Instead you can write like this!!! n=int(input("Enter number of elements : ")) Lst=[n for x in range(0,n)] print(Lst)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Yes you can :)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
@irene if you want different input in list then you need to use input function inside the list.
@SJ-ic4yr
@SJ-ic4yr 3 жыл бұрын
@@AmulsAcademy yup
@SJ-ic4yr
@SJ-ic4yr 3 жыл бұрын
@@AmulsAcademy this will make a list of first n-1 integers
@sakthisurya4522
@sakthisurya4522 3 жыл бұрын
How find duplicate in this method
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Do you want to find duplicate values in list ?
@nikhil_polani
@nikhil_polani 3 жыл бұрын
suppose if we want to give the inputs as a list format 10 20 22 like this in the output.....how to write that.? for example we need to take 3 input values in a list format at the time of execution a=10 20 22 b=51 21 23
@vasudhas3648
@vasudhas3648 3 жыл бұрын
Hey did u got code for u r qstion .i too searching for that .did u found it share it pls
@kabeerbasha326
@kabeerbasha326 3 жыл бұрын
Amulya when will be the python new batch starts
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Soon :)
@Ramesh-rp6jq
@Ramesh-rp6jq 3 жыл бұрын
@@AmulsAcademy is this paid course?
@ibrahimgadli2583
@ibrahimgadli2583 2 жыл бұрын
I got this part but if I want to create n number of list for example: pls enter the number of list you want:2 Enter the length : 4 A b c d [A b c d] Enter the length : 4 B c d e [B c d e] How to make it like this Simply I want to ask how to create more than 1 list using user input
@MDHabib-wx2zu
@MDHabib-wx2zu 2 жыл бұрын
you can say nicely....
@keerthanat6649
@keerthanat6649 3 жыл бұрын
If the input already exist or not what will be the programme
@paramasivaanand
@paramasivaanand 2 жыл бұрын
for some reason eval is not working in jupyter. Is anyone else tried eval in jupyter?
@acidicunicorn8884
@acidicunicorn8884 3 жыл бұрын
How to add n elements in list without pressing enter n times?
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
You can enter values using space then you can separate that 😊
@acidicunicorn8884
@acidicunicorn8884 3 жыл бұрын
@@AmulsAcademy i can't press space n times
@selvanm2872
@selvanm2872 3 жыл бұрын
👍
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@Ramesh-rp6jq
@Ramesh-rp6jq 3 жыл бұрын
Hi , In user input I provided 5 elements but in the output its giving 3 elements only.
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Give me the program please :)
@Ramesh-rp6jq
@Ramesh-rp6jq 3 жыл бұрын
@@AmulsAcademy list1=[ ] while True: element=int(input ('Enter element')) list1.append(element) Choice=input('want to stop?if yes press yes') If choice=='yes' Break Print('list of elements ' , list1)
@Ramesh-rp6jq
@Ramesh-rp6jq 3 жыл бұрын
@@AmulsAcademy it's working
@nehakamath8321
@nehakamath8321 3 жыл бұрын
@@Ramesh-rp6jq @Amulya's Academy import ast list1=[ ] while True: element=ast.literal_eval(input ('Enter element: ')) list1.append(element) choice=input('want to stop? enter yes: ') if choice =='yes': break print('list of elements ' , list1) For the above code ,its taking a floating point value and integer value but its not taking a character . Can you tell me if I have made a mistake?
@nehakamath8321
@nehakamath8321 3 жыл бұрын
I got my mistake I was not entering the character in between the " " (for example : " ant ")
@prathapmadduri3616
@prathapmadduri3616 3 жыл бұрын
Hi mam I found that 'ProgramsAndMe' is a channel that channel copying ur videos mam so be care about it mam
@iamgonnastudy2009
@iamgonnastudy2009 2 жыл бұрын
😃👍👍👍👍👍👍👍👍
@pranjalchakraborty3880
@pranjalchakraborty3880 3 жыл бұрын
How can we take user input of char, float, int values simultaneously??
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
You need to use eval function or literal_eval function from ast module :)
@simplesingh5334
@simplesingh5334 3 жыл бұрын
@@AmulsAcademy how does it work? Can you please explain alil?
@hrithikjudhun7344
@hrithikjudhun7344 3 жыл бұрын
What if i want to insert decimal values in the list? 😅
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Float ?
@hrithikjudhun7344
@hrithikjudhun7344 3 жыл бұрын
@@AmulsAcademy Yes I got it, thank you..🤙💫
@sikandarkumar7563
@sikandarkumar7563 3 жыл бұрын
Can we use map function for this list
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Yes you can :)
@samsamson1414
@samsamson1414 3 жыл бұрын
what about for nexted list of two dimension pls
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
I will try to make videos on that :)
@maciekpaciarski9343
@maciekpaciarski9343 3 жыл бұрын
when continuation of doubly linked list ?
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Tomorrow :)
@Venaxr
@Venaxr 3 жыл бұрын
Hello i need to make a program that is supposed to do this: For the first question, your program should randomly select a planet, display its name, and ask the user for its position in the solar system, with respect to the Sun. Example: Correct answer Note: This example illustrates how your program should work. The output of your program will depend on the randomly-selected planet and the user’s input, so it will be different each time you execute it. The program displays a prompt and waits for keyboard input What is the position of Earth, relative to the Sun? The user types in a reply 3 The program displays a message that the user’s answer is correct That is correct. Earth is planet number 3 from the Sun. Example: Incorrect answer Note: This example illustrates how your program should work. The output of your program will depend on the randomly-selected planet and the user’s input, so it will be different each time you execute it. The program displays a prompt and waits for keyboard input What is the position of Mars, relative to the Sun? The user types in a reply 5 The program displays a message that the user’s answer is incorrect, along with the correct answer That is not correct. Mars is planet number 4 from the Sun. Please can you help me
@Venaxr
@Venaxr 3 жыл бұрын
I am also very bad at python and very new
@Venaxr
@Venaxr 3 жыл бұрын
import random from random import randint planets = ["Mercury", "Venus", "Earth","Mars", "Jupiter", "Saturn","Uranus", "Neptune"] value = random.choice(planets) print("What is the position of",value +",relative to the sun?") planet = input() index = randint(0,7) planet = planets[index] print("That is correct.",planet +" is planet number",randint +"from the sun") THis what I put
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Execute this program and see what you will get 😊
@Venaxr
@Venaxr 3 жыл бұрын
@@AmulsAcademy thanks miss!
@harshitpatni9483
@harshitpatni9483 3 жыл бұрын
I am not first
@hassaan1670
@hassaan1670 2 жыл бұрын
yen lmao sry
@abdi_pie7266
@abdi_pie7266 3 жыл бұрын
not showing face
@075_mmshahriarshakil2
@075_mmshahriarshakil2 3 жыл бұрын
Are you girl or boy? I am confused 😁
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Girl 😊
@075_mmshahriarshakil2
@075_mmshahriarshakil2 3 жыл бұрын
@@AmulsAcademy fall in love 🤭 for voice
@YeshwaVlog
@YeshwaVlog 2 жыл бұрын
thank you
Python Tutorials - Happy Numbers
25:33
Amulya's Academy
Рет қаралды 10 М.
Input a List using Loops in Python
10:24
Neso Academy
Рет қаралды 35 М.
Je peux le faire
00:13
Daniil le Russe
Рет қаралды 9 МЛН
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 16 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 94 МЛН
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 440 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,1 МЛН
User Input For List | Python Programs
9:01
ProgramsAndMe
Рет қаралды 3,9 М.
How To Think Like A Programmer
1:00:07
Coding Tech
Рет қаралды 2 МЛН
All Python Syntax in 25 Minutes - Tutorial
24:59
Beau
Рет қаралды 38 М.
Python Tutorial for Absolute Beginners #1 - What Are Variables?
24:38
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 466 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 941 М.
User input in Python is easy + exercises ⌨️
13:04
Bro Code
Рет қаралды 99 М.