Navigating a Python list within a while loop

  Рет қаралды 11,667

John Philip Jones

John Philip Jones

Күн бұрын

In this video tutorial I look at how the while loop can be used to navigate over a Python lists. This allows for highlighting the indexed nature of a Python list. In addition it explains the IndexError: list index out of range

Пікірлер: 24
@user-yz5jf1qx7r
@user-yz5jf1qx7r Жыл бұрын
Best description I've gotten for list with while look yet. Thanks!
@johnphilipjones
@johnphilipjones Жыл бұрын
Glad it was helpful Best wishes Phil
@TruthbetoldtotheWorld
@TruthbetoldtotheWorld 2 жыл бұрын
You’re the best Sir, you’ve made me understood what my instructor could not within a month.
@johnphilipjones
@johnphilipjones 2 жыл бұрын
Glad the video was helpful. Thank you for the positive comments. Best wishes Phil (John Philip Jones)
@zani2693
@zani2693 Жыл бұрын
wow, thank you so much, sir. i was having some trouble with an assignment my teacher gave me, and this helped me greatly!
@imedayari1
@imedayari1 5 жыл бұрын
Great tuto, thank you for sharing
@fabiolsmineiro
@fabiolsmineiro 2 жыл бұрын
You're quite a good explanator, i'll subscribe.
@nathalytapia805
@nathalytapia805 4 жыл бұрын
Very nicce explained! thank you a lot
@TerryMaplePoco
@TerryMaplePoco 2 жыл бұрын
damn this is top notch elucidation. thank you!!
@tonytony-hz1cg
@tonytony-hz1cg 3 жыл бұрын
such wonderful explanation , I LOVE IT
@johnphilipjones
@johnphilipjones 3 жыл бұрын
Thank you for your positive feedback it is appreciated. Best wishes Phil
@thecyclops2449
@thecyclops2449 2 жыл бұрын
so wonderful explanation, a was trying to solve a problem for like 1 hour and was starting to lose my mind haha. Thank you sooooooooo... soooooo... much!
@johnphilipjones
@johnphilipjones 2 жыл бұрын
Glad it helped Best wishes Phil (John Philip Jones)
@adrianobarbosa-buenosaires2789
@adrianobarbosa-buenosaires2789 6 жыл бұрын
Thanks .. great
@tazarttanalt3097
@tazarttanalt3097 4 жыл бұрын
very clair👏
@huzaifabaloch2318
@huzaifabaloch2318 5 жыл бұрын
❤️❤️❤️❤️
@EyeIn_The_Sky
@EyeIn_The_Sky 5 жыл бұрын
Hello is the "[i]" part of the print statement explained in previous videos, I can't find it. I would like to know its function since we are already asking the program to ouput the list by name which will print the same numbers as well. Ok so after running a variation I see that without the [i] part to ask the interpreter to print the number by index order you will just get a print out of the whole list not every number by order. so without "[ i ]" CODE: list_a = list([23,71,8]) i = 0 while i
@johnphilipjones
@johnphilipjones 5 жыл бұрын
Use [i] to access individual elements of the list. Regards Phil
@jaredbmorris1498
@jaredbmorris1498 3 жыл бұрын
what if your list is composed of strings and not integers? I keep getting this error: TypeError: '
@johnphilipjones
@johnphilipjones 3 жыл бұрын
I would need to see the code to answer this. Please paste it as a comment to this reply. Best wishes Phil
@71rohith
@71rohith 4 жыл бұрын
Hello, here we have two lists a = [1,2,3] and b = [1,2,3], why do both object a and b has a different id, why not the same id? Although the elements 1, 2 and 3 are objects of integer class, they will have same id.
@johnphilipjones
@johnphilipjones 4 жыл бұрын
Have a look at the following video it shows how the id() works with lists: kzbin.info/www/bejne/mIi3qWmLiLRmfZI Best wishes Phil
@lakeguy65616
@lakeguy65616 2 жыл бұрын
I'm confused. this [] defines a list and () creates a tuple and the list() recasts a collection object into a list. so list([a collection]) seems redundant to me. you have list inside a tuple, then recast into a list. what am I not seeing? Outstanding videos!
@johnphilipjones
@johnphilipjones 2 жыл бұрын
Data types can be cast into other date types (i.e. changed). Different data types can be processed with different degrees of efficiency. You would frequently change the data type to ensure that your code ran as efficiently as possible (i.e. faster and/or take up less memory). In addition data types can be mutable or immutable. You may for example want to process the data without changing the data in the data structure (i.e. sum all the data). In which case choosing an immutable data type (structure) would offer the best protection against change. Best wishes Phil
The Python len function and lists
7:40
John Philip Jones
Рет қаралды 23 М.
Using the Python help function to assist with inheritance
18:10
John Philip Jones
Рет қаралды 5 М.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 98 МЛН
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 117 МЛН
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 23 МЛН
Python Methods and self
13:48
John Philip Jones
Рет қаралды 43 М.
#20 Python Tutorial for Beginners | While Loop in Python
12:43
Telusko
Рет қаралды 1,6 МЛН
Input a List using Loops in Python
10:24
Neso Academy
Рет қаралды 32 М.
Nested while Loop in Python
12:49
Neso Academy
Рет қаралды 12 М.
How to generate a random colour (color) in Python
17:33
John Philip Jones
Рет қаралды 9 М.
Introduction to the Python List
22:56
John Philip Jones
Рет қаралды 6 М.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 98 МЛН