Input a List using Loops in Python

  Рет қаралды 32,619

Neso Academy

Neso Academy

Жыл бұрын

Python Programming: Input a List using Loops in Python
Topics discussed:
1. Problem associated with the input() Method.
2. Input a List using Loops.
Python Programming Playlist: • Python Programming
Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
Contribute: www.nesoacademy.org/donate
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy.org/recommend...
Website ► www.nesoacademy.org/
Forum ► forum.nesoacademy.org/
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#PythonByNeso #PythonProgramming #ListsInPython

Пікірлер: 22
@b07_ashishsuradkar49
@b07_ashishsuradkar49 Жыл бұрын
Great video sir.
@wisdomoregfx
@wisdomoregfx 5 ай бұрын
You are a life saver. Thanks ❤
@sgiri2012
@sgiri2012 Жыл бұрын
Thank you for your class sir
@muhammadbinuzair2101
@muhammadbinuzair2101 3 ай бұрын
It was really helpful Thank you
@jingersatuh6322
@jingersatuh6322 5 ай бұрын
Clear explanation.
@lionelfaith3646
@lionelfaith3646 9 ай бұрын
@Neso academy Great video , it helps me a lot as usual but what about if we want a list which is a collection of different types of items ? because with the example in the course all the items of our list must be an integer
@tecolote8566
@tecolote8566 4 ай бұрын
NICE!!
@user-xc7uz5xg9y
@user-xc7uz5xg9y 6 ай бұрын
Sir, instead of using for loop to input a list we can use split function... numbers = input().split()
@pawansaxena1304
@pawansaxena1304 4 ай бұрын
sir i have a doubt can't we directly use eval function for entering the list sir i had tried it and also work so why to use loop method
@alimuhtasham4045
@alimuhtasham4045 4 күн бұрын
what about this code ? numbers = [ ] for i in range(3): x = input('Enter the element: ') numbers.append(x) print(numbers)
@handle_gc
@handle_gc 9 ай бұрын
This can also be achieved using below code for storing items as string not int. items = input("Enter multiple items: ") list = items.split() print(list)
@AmanKumar-fj2lz
@AmanKumar-fj2lz 5 ай бұрын
Tems??
@AmanKumar-fj2lz
@AmanKumar-fj2lz 5 ай бұрын
No its still a string.. Python3IDE(Python 3.7) running! enter the 3 digit number234 ['234'] Pytho3IDE run end!
@fifthamendment1
@fifthamendment1 9 ай бұрын
Thanks for the vid. Just a suggestion… what if you need to input hundreds of numbers? The user is not going to want take a count of each number and possibly miscount. Might be better just to input numbers and type END when finished.
@sagnikadhya3425
@sagnikadhya3425 7 ай бұрын
I guess using while loop would be better then
@lionelfaith3646
@lionelfaith3646 9 ай бұрын
n=int(input("enter the number of elements of your list: ")) #input data from the user and convert it to integer type numbers=[] #create an empty list for i in range(n): #iterate my list from index 0 to n-1 and repeat the block of instructions below for each i x = int(input(f"enter the elements for numbers {[i]}: ")) #store the elements of the list from user in x variable numbers.append(x) #add each element at the end of the list numbers print(numbers) #output the new list
@user-ev5fj1rm3y
@user-ev5fj1rm3y 7 ай бұрын
I don't get where the i came from in for loop
@kaifXD
@kaifXD 3 ай бұрын
@@user-ev5fj1rm3ywe just take a variable i to loop thru.. in this case for loop
@pgkgaming4229
@pgkgaming4229 3 ай бұрын
❤❤❤🎉
@internetguy3978
@internetguy3978 2 ай бұрын
Please use an ide... Command prompt sucks
@nesoacademy
@nesoacademy 2 ай бұрын
We started using VS Code after covering the basics.
Input a List using split() Method in Python
8:27
Neso Academy
Рет қаралды 33 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 334 М.
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 30 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
Nested Loops in Java
10:09
Neso Academy
Рет қаралды 267 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 903 М.
Python: While Loops (Reading User Input Indefinitely?!!)
14:40
Pointers (Important Questions)
11:11
Neso Academy
Рет қаралды 335 М.
input() Method in Python
9:21
Neso Academy
Рет қаралды 19 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 231 М.
6 Tips to write BETTER For Loops in Python
9:19
Patrick Loeber
Рет қаралды 247 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 253 М.
#20 Python Tutorial for Beginners | While Loop in Python
12:43
Telusko
Рет қаралды 1,6 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН