Title | : | Python 2D collections are easy ⬜ |
Duration | : | 08:39 |
Viewed | : | 39,990 |
Published | : | 08-11-2022 |
Source | : | Youtube |
#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()
![]() |
Create a QUIZ GAME with Python 💯 09:29 - 188,016 |
![]() |
Python dictionaries are easy 📙 08:06 - 202,099 |
![]() |
10 Python Comprehensions You SHOULD Be Using 21:35 - 124,997 |
![]() |
Generate random numbers in Python 🎲 08:03 - 53,444 |
![]() |
Python lists, sets, and tuples explained 🍍 15:06 - 240,269 |
![]() |
Please Master These 10 Python Functions… 22:17 - 73,558 |
![]() |
Multidimensional Lists in Python 09:10 - 6,399 |
![]() |
Python shopping cart program 🛒 07:14 - 94,361 |