User Input For List | Python Programs

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • 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 роки тому +7

    The Easiest and the most clear explaination I've seen on youtube. Tysm

  • @3delhelal
    @3delhelal 3 роки тому +18

    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 ♥️

  • @ranadeepsaha9696
    @ranadeepsaha9696 3 роки тому +1

    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.

  • @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.

  • @kumodsharma7235
    @kumodsharma7235 2 роки тому

    Wow , Thanku mam for this beautiful explanation all doubts is cleared in a single tutorial video

  • @GhostDcuo
    @GhostDcuo 2 роки тому +1

    Hey, great tutorial thanks for the upload. I've been struggling with this all day but i finally get it lol, and thanks again.

  • @xNatheeeGamer
    @xNatheeeGamer 2 роки тому

    Thanks Amulya, you're a legend!

  • @RaviKumar-cr7qc
    @RaviKumar-cr7qc 3 роки тому +1

    good teaching and easly understandig, in for loop in empty list

  • @NachoNC320
    @NachoNC320 3 роки тому

    Muchas gracias por ayudarme Amulya si no era por ti, seguiria renegando con las listas. Te agradezco de corazon.

  • @nicolledenipitiya7567
    @nicolledenipitiya7567 2 роки тому +1

    It really helped me
    Thank you so much !!!

  • @drakslayer6972
    @drakslayer6972 3 роки тому +2

    Thank you for your effort and clear explanation. This helps me so much at python

  • @joyprokash4013
    @joyprokash4013 Рік тому

    Thank you so much. Please provide us Data Science courses also mam.

  • @alimanager
    @alimanager 3 роки тому

    It indeed helped me in understanding control on user inputs. Thanks.

  • @theunknownWitsom
    @theunknownWitsom 3 роки тому

    Thank you for the help! Very concise video explanation

  • @paramasivaanand
    @paramasivaanand 2 роки тому

    Thanks for the great explanation. It really helped me on understanding the full flow.

  • @htbgamer4548
    @htbgamer4548 3 роки тому +1

    hello from us, thank u:)

  • @AmitSingh-ty5hw
    @AmitSingh-ty5hw 3 роки тому +1

    amazing video

  • @AnkitSingh-vj6dz
    @AnkitSingh-vj6dz 2 роки тому +1

    Thank you ma'am

  • @MRCRAZY-wm4ln
    @MRCRAZY-wm4ln 3 роки тому +1

    thanks maam for such a nice lesson....
    congo for 101k....
    keep making such videos, thank you once again

  • @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❤️

  • @apurbadebnath4342
    @apurbadebnath4342 2 роки тому

    Very good explanation

  • @parthasarathejay.7957
    @parthasarathejay.7957 3 роки тому +2

    Thank you so much, sis. Saved my life!

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      😊😊😊

    • @priyanshusharma2144
      @priyanshusharma2144 3 роки тому

      How she saved your life 🤔🤔

    • @parthasarathejay.7957
      @parthasarathejay.7957 3 роки тому +1

      @@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. 😅

  • @hazyhaul5720
    @hazyhaul5720 3 роки тому +1

    You are the best sweat heart... Thanks

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому +1

      Thank you 😊

    • @hazyhaul5720
      @hazyhaul5720 3 роки тому

      Your explain well, you can help summarise GUI and py to exe

  • @azadnagar3929
    @azadnagar3929 3 роки тому +1

    Really nice voice and helpful concept

  • @oodlesofawe
    @oodlesofawe 2 роки тому +1

    Thanks a lot!!!

  • @RealRadaiZabala
    @RealRadaiZabala 2 місяці тому

    Thanks, amulyia.

  • @francismannion7075
    @francismannion7075 5 місяців тому

    That was great , thank you.

  • @RuhulAmin-hg6lj
    @RuhulAmin-hg6lj 3 роки тому +1

    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

  • @subasreev5189
    @subasreev5189 3 роки тому +1

    It really helped me
    Thank you so much

  • @Kitchen24000
    @Kitchen24000 4 роки тому +2

    Amulya shetty good one again

  • @myerwerl
    @myerwerl 3 роки тому +1

    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.

  • @CouldbeSample
    @CouldbeSample 3 роки тому +1

    hug thanks from Brazil dud

  • @sumitchandora1183
    @sumitchandora1183 3 роки тому +1

    Best videos :)

  • @MiaTheDreamer
    @MiaTheDreamer 3 роки тому

    Thanks loads..

  • @J35513gORaYa
    @J35513gORaYa 3 роки тому +1

    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

  • @zakjay6748
    @zakjay6748 3 роки тому +1

    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 :(

  • @feziwezimu931
    @feziwezimu931 3 роки тому +1

    thanks, mam for the lesson but how do you
    use that code then add it up?

  • @urbanevolutionlifestyle6209
    @urbanevolutionlifestyle6209 2 роки тому

    Thank you

  • @ajkoh
    @ajkoh 2 роки тому

    Hey, if i want the user to have the choice to remove something from the list aswell, how do i do that?

  • @kabeerbasha326
    @kabeerbasha326 4 роки тому +1

    Amulya when will be the python new batch starts

  • @mamillasrihari5791
    @mamillasrihari5791 Рік тому

    How to give heterogeneous input for list in single line from user end?

  • @SJ-ic4yr
    @SJ-ic4yr 4 роки тому +1

    n=int(input(“Enter number of elements : “))
    Lst=[int(input(“Enter element : “)) for x in range(0,n)]
    Will this work?

    • @irenechelsia1160
      @irenechelsia1160 4 роки тому +1

      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  4 роки тому

      Yes you can :)

    • @AmulsAcademy
      @AmulsAcademy  4 роки тому +1

      @irene if you want different input in list then you need to use input function inside the list.

    • @SJ-ic4yr
      @SJ-ic4yr 4 роки тому

      @@AmulsAcademy yup

    • @SJ-ic4yr
      @SJ-ic4yr 4 роки тому

      @@AmulsAcademy this will make a list of first n-1 integers

  • @theme6865
    @theme6865 Рік тому

    thank u❤❤❤❤❤❤

  • @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?

  • @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

  • @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?

  • @prageetgames
    @prageetgames 2 роки тому

    what if i have to find the maximum value from a multiple user inputs what will be the code?

  • @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!

  • @pinkytrivedi5665
    @pinkytrivedi5665 3 роки тому +2

    We can use eval in input :)

  • @sivasu07
    @sivasu07 4 роки тому +1

    Asusual 👌👍

  • @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

  • @DhruvGoyaI
    @DhruvGoyaI 2 роки тому +1

    I am typing lst = []
    it is giving syntax error please tell why ?

  • @keerthanat6649
    @keerthanat6649 3 роки тому

    If the input already exist or not what will be the programme

  • @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

  • @shivanshugour4975
    @shivanshugour4975 3 роки тому

    for chuck yen times ok mam got it

  • @arpit8720
    @arpit8720 Рік тому

  • @universal4334
    @universal4334 4 роки тому +1

    Do the same for indepth about lambda , map

  • @Ramesh-rp6jq
    @Ramesh-rp6jq 4 роки тому +1

    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

  • @apurbadebnath4342
    @apurbadebnath4342 2 роки тому

    You are boss

  • @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?

  • @sakthisurya4522
    @sakthisurya4522 3 роки тому +1

    How find duplicate in this method

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      Do you want to find duplicate values in list ?

  • @paramasivaanand
    @paramasivaanand 2 роки тому

    for some reason eval is not working in jupyter. Is anyone else tried eval in jupyter?

  • @tquadtechno7472
    @tquadtechno7472 5 місяців тому

    COMMENDABLE. Could not be better

  • @acidicunicorn8884
    @acidicunicorn8884 3 роки тому +1

    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

  • @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 роки тому +1

      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!

  • @hrithikjudhun7344
    @hrithikjudhun7344 3 роки тому +1

    What if i want to insert decimal values in the list? 😅

  • @selvanm2872
    @selvanm2872 4 роки тому +1

    👍

  • @MDHabib-wx2zu
    @MDHabib-wx2zu 2 роки тому

    you can say nicely....

  • @sikandarkumar7563
    @sikandarkumar7563 4 роки тому +1

    Can we use map function for this list

  • @maciekpaciarski9343
    @maciekpaciarski9343 3 роки тому +1

    when continuation of doubly linked list ?

  • @iamgonnastudy2009
    @iamgonnastudy2009 2 роки тому

    😃👍👍👍👍👍👍👍👍

  • @samsamson1414
    @samsamson1414 3 роки тому +1

    what about for nexted list of two dimension pls

    • @AmulsAcademy
      @AmulsAcademy  3 роки тому

      I will try to make videos on that :)

  • @harshitpatni9483
    @harshitpatni9483 4 роки тому

    I am not first

  • @abdi_pie7266
    @abdi_pie7266 3 роки тому

    not showing face

  • @hassaan1670
    @hassaan1670 2 роки тому

    yen lmao sry

  • @075_mmshahriarshakil2
    @075_mmshahriarshakil2 3 роки тому +1

    Are you girl or boy? I am confused 😁

  • @YeshwaVlog
    @YeshwaVlog 2 роки тому

    thank you