Python Crash Course #4 - Containers

preview_player
Показать описание
In this Python crash course tutorial series, you'll learn all the basics of Python from the ground up.

🚀🥷🏼Get access to the Python Crash Course on Net Ninja Pro:

🔥🥷🏼 Access Premium Courses with a Net Ninja Pro subscription:

🔗🥷🏼 Check out Clear Code for more of his own tutorials:

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

Thanks for the great content @netninja as always.
Another way of getting the same result is to do the indexing backwards (from the end on wards) i.e -1, -2, -3...etc
Therefore, another solution to the exercise would be print(exercise_list[-3::-2])

MustafaAli-vevm
Автор

Set also printing the element randomly.

what a crazy am I!😂 i solve this way before watching explanation.
ex_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
new_lsit = ex_list[1:8:2]
new_lsit.reverse()
print(new_lsit)

ashikulislamdev
Автор

The „4 as the stop is only up to“ saved some of my braincells. thanks! I wonder why professors can‘t explain it this easy

julianer
Автор

at the exercise i chose to do it backwards like this
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(my_list[-3:-10:-2])
what i thought after running this was what if the list would be too big then what do i do?

perparimavdiu
Автор

My solution:
a_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
new_list = a_list[1:9:2]
new_list.sort(reverse = True)
print(new_list)

simondanielssonmusic
Автор

What is the use of everything we are learning here? I have zero knowledge of coding and I want to learn it, but what I feel is like we can do these things shown in video in Excel easily then why are we doing it here.

anujchauhan