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 Жыл бұрын
Best description I've gotten for list with while look yet. Thanks!
@johnphilipjones Жыл бұрын
Glad it was helpful Best wishes Phil
@TruthbetoldtotheWorld2 жыл бұрын
You’re the best Sir, you’ve made me understood what my instructor could not within a month.
@johnphilipjones2 жыл бұрын
Glad the video was helpful. Thank you for the positive comments. Best wishes Phil (John Philip Jones)
@zani2693 Жыл бұрын
wow, thank you so much, sir. i was having some trouble with an assignment my teacher gave me, and this helped me greatly!
@imedayari15 жыл бұрын
Great tuto, thank you for sharing
@fabiolsmineiro2 жыл бұрын
You're quite a good explanator, i'll subscribe.
@nathalytapia8054 жыл бұрын
Very nicce explained! thank you a lot
@TerryMaplePoco2 жыл бұрын
damn this is top notch elucidation. thank you!!
@tonytony-hz1cg3 жыл бұрын
such wonderful explanation , I LOVE IT
@johnphilipjones3 жыл бұрын
Thank you for your positive feedback it is appreciated. Best wishes Phil
@thecyclops24492 жыл бұрын
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!
@johnphilipjones2 жыл бұрын
Glad it helped Best wishes Phil (John Philip Jones)
@adrianobarbosa-buenosaires27896 жыл бұрын
Thanks .. great
@tazarttanalt30974 жыл бұрын
very clair👏
@huzaifabaloch23185 жыл бұрын
❤️❤️❤️❤️
@EyeIn_The_Sky5 жыл бұрын
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
@johnphilipjones5 жыл бұрын
Use [i] to access individual elements of the list. Regards Phil
@jaredbmorris14983 жыл бұрын
what if your list is composed of strings and not integers? I keep getting this error: TypeError: '
@johnphilipjones3 жыл бұрын
I would need to see the code to answer this. Please paste it as a comment to this reply. Best wishes Phil
@71rohith4 жыл бұрын
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.
@johnphilipjones4 жыл бұрын
Have a look at the following video it shows how the id() works with lists: kzbin.info/www/bejne/mIi3qWmLiLRmfZI Best wishes Phil
@lakeguy656162 жыл бұрын
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!
@johnphilipjones2 жыл бұрын
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