Reverse List using for loop in Python | List in python | Python List | #shorts #python #ytshorts

preview_player
Показать описание
Reverse the following list without using
reverse method. Use for loop to iterate.
myList = [10,"abc",20,3.5,"xyz"]
Expected Output:
["xyz",3.5,20,"abc",10]

new video for python programming
python code for problem solving approach.
- python for beginners
- learn python in simple way.
- first clear basic concepts.
- solve more problems and consistent practice

List in Python Program
python problem solving shorts
python programming for beginners
python programming example
reverce list using for loop
learn python

#shorts #ytshorts #pythonprogram #tutorial #education #learning #python programmer #python #4k #education #data science

Рекомендации по теме
Комментарии
Автор

I had a project in which using loop was compulsory. I tried really hard but couldn't do thanku muchh❤❤

khushibhushan
Автор

My guy.. thank you so freaking much!! I never thought of defining a newList variable and using the append with negative i as an index, i was making for loops to overwrite the list elements with index j to index len(list) - j but It didnt work...thank you!!

marcolinodallacampagna
Автор

hey, nice video. It's an okay way to reverse a list for beginners but there are various ways to make it easy. For example

*arr = [] # Array here*
*arr.reverse() # Will reverse the original array*

*print(arr)*

or alternatively if you don't want to reverse the original array too

*print(arr[::-1])* # Using the unreversed list from above, if you curious how it works, learn about indexing

I can't say I never reversed a list like that especially when I am new. But these are few convenient ways to do it instead using a loop

IMCYT
visit shbcf.ru