Тёмный

Python 2D collections are easy ⬜ 

Bro Code
Подписаться 1,9 млн
Просмотров 37 тыс.
50% 1

#python #tutorial #course
00:00:00 intro
00:06:11 exercise
Here are a few different 2d collection combinations:
2D list of lists
num_pad = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
["*", 0, "#"]]
2D list of tuples
num_pad = [(1, 2, 3),
(4, 5, 6),
(7, 8, 9),
("*", 0, "#")]
2D list of sets
num_pad = [{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{"*", 0, "#"}]
2D tuple of lists
num_pad = ([1, 2, 3],
[4, 5, 6],
[7, 8, 9],
["*", 0, "#"])
2D tuple of tuples
num_pad = ((1, 2, 3),
(4, 5, 6),
(7, 8, 9),
("*", 0, "#"))
2D tuple of sets
num_pad = ({1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{"*", 0, "#"})
2D set of lists (NOT VALID)
num_pad = {[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
["*", 0, "#"]}
2D set of tuples
num_pad = {(1, 2, 3),
(4, 5, 6),
(7, 8, 9),
("*", 0, "#")}
2D set of sets (NOT VALID)
num_pad = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9},
{"*", 0, "#"}}
for row in num_pad:
for num in row:
print(num, end=" ")
print()

Опубликовано:

 

2 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@BroCodez
@BroCodez Год назад
Here are a few different 2d collection combinations: # 2D list of lists num_pad = [[1, 2, 3], [4, 5, 6], [7, 8, 9], ["*", 0, "#"]] # 2D list of tuples num_pad = [(1, 2, 3), (4, 5, 6), (7, 8, 9), ("*", 0, "#")] # 2D list of sets num_pad = [{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {"*", 0, "#"}] # 2D tuple of lists num_pad = ([1, 2, 3], [4, 5, 6], [7, 8, 9], ["*", 0, "#"]) # 2D tuple of tuples num_pad = ((1, 2, 3), (4, 5, 6), (7, 8, 9), ("*", 0, "#")) # 2D tuple of sets num_pad = ({1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {"*", 0, "#"}) # 2D set of lists (NOT VALID) num_pad = {[1, 2, 3], [4, 5, 6], [7, 8, 9], ["*", 0, "#"]} # 2D set of tuples num_pad = {(1, 2, 3), (4, 5, 6), (7, 8, 9), ("*", 0, "#")} # 2D set of sets (NOT VALID) num_pad = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {"*", 0, "#"}} for row in num_pad: for num in row: print(num, end=" ") print()
@kszoknyik
@kszoknyik Год назад
thank you! i was struggling with this and you made it make sense :)
@gaga40
@gaga40 Год назад
Watching your 12 hour java video right now, keep up the good work Bro
@kladzen
@kladzen Год назад
just started 2 days ago trying to learn python.. really great tutorials! keep up the good work. I have some projects both work related and personal stuff where i wanna use python to do some automation work in the end and this is really helping me!
@paultvshow
@paultvshow 5 месяцев назад
Hey, how have your Python skills progressed after 11 months of learning? I have just started my machine learning journey for about a month too.
@nicolewynne4781
@nicolewynne4781 Год назад
Please could you do PHP beginner full course? Your videos are like an oasis in the desert for people like us who have financial struggles. Thanks a million BRO!!!
@chickennuggies0242
@chickennuggies0242 Год назад
I love watching your videos. I learn so much so easily
@Ravi.Kumar-
@Ravi.Kumar- Год назад
Thanks 😊. Pls tutorial on recursion stuff.
@Jack_Victal
@Jack_Victal 6 месяцев назад
Thank you very much!
@AmericanMaking
@AmericanMaking Год назад
Very helpful.
@zaparilty1770
@zaparilty1770 10 месяцев назад
Hello there, I wanted to thank you first and donate some money instead of spending them on another course but youtube said I am not allowed to donate from my country of residence. Sadly. So, I just want to thank you for your videos and the way you teach. I've done a dozen of courses including CS50, Udemy courses and so on. But none of them were as helpful as your approach with 'teach a lesson' -> 'complete a mini - project'. This's just amazing. To every project of yours that you taught I added something else and updated it in some ways to make it my own and yet I wonder, would those innumerous projects be of any help when it comes to landing a job? I have done like 20-25 of them but they are tiny, very diverse indeed but tiny, never exceed even a hundred of lines of code. Will they actually matter when the time comes? Just your opinion on their worth. Thanks.
@MrKampay
@MrKampay Год назад
thank you bro!
@slppocommel3762
@slppocommel3762 Год назад
thank you bro code you help a lot!!!!!
@kpieceemmry3387
@kpieceemmry3387 4 месяца назад
Still a little bit confuse how print() makes it lay let say end=“ “ create inform the item to be only separated by space not line then how come the peint() returns the food in rows
@kristijanlazarev
@kristijanlazarev 3 месяца назад
bomb
@captainhostile101
@captainhostile101 6 месяцев назад
lets hope i pass my test tomorrow ://
@The_Lahmacun123
@The_Lahmacun123 4 месяца назад
Did you?
@captainhostile101
@captainhostile101 4 месяца назад
@@The_Lahmacun123 yes sir i did, passed the course too. Thanks!
@derpfisti2457
@derpfisti2457 Год назад
step 3 = done step 1 = done 👍 step 2 = done 🗯 watching your vids just a few days now, but i never learned so much in such a short time! Thanks Bro and keep on going!
@harisshafi01
@harisshafi01 Год назад
dial_pad = [["1 2 3"], ["4 5 6"], ["7 8 9"], ["* 0 #"]] for dailer in dial_pad: for num in dailer: print(num, end=" ") print() OUTPUT : 1 2 3 4 5 6 7 8 9 * 0 #
Далее
Python lists, sets, and tuples explained 🍍
15:06
Просмотров 224 тыс.
Create a QUIZ GAME with Python 💯
9:29
Просмотров 179 тыс.
Functions in Python are easy 📞
10:38
Просмотров 379 тыс.
Python shopping cart program 🛒
7:14
Просмотров 89 тыс.
Python dictionaries are easy 📙
8:06
Просмотров 190 тыс.
While loops in Python are easy ♾️
6:58
Просмотров 304 тыс.
GCSE Python #10: Lists (1D and 2D)
16:58
Просмотров 6 тыс.
#5 Python Tutorial for Beginners | List in Python
10:42
How to Use Lists in Python
18:49
Просмотров 285 тыс.