CODE TECH™ (channel)
227 subscribers
42 photos
1 video
8 files
21 links
“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler

Channel ➻ @h_programming
Group ➻ @h_programmers_group
Bot ➻ @h_gramBot
Download Telegram
⚜ Dictionary | ማጠቃለያ
------------------------------------------

dictionary አንዱ የ python data type ሱሆን በ ዉስጡ key-value pair 'ኦችን ለማስቀመጥ ይጠቅማል : :

list ላይ እና tuple ላይ index 'ን በመጠቀም element 'እችን access እንደምናረገዉ ሁሉ dictionary ላይ ደሞ #key 'ን በመጠቀም #value 'ን access ማረግ እንችላለን : : ለምሳሌ key 'ን በመጠቀም :-

👉 key-value pair ወደ dictionary ማስገባት (https://t.me/h_programming/422)

👉 key 'ላይ የሚገኘዉን value በሌላ value መቀየር (https://t.me/h_programming/423)

👉 value 'ን ነጥለን ማዉጣት (https://t.me/h_programming/425)

👉 key-value pair መደለት (https://t.me/h_programming/429)

... እንደምንችል አይተናል : :

🔺 Dictionary mutable data type እንደሆነም አይተናል (https://t.me/h_programming/425)


ባጠቃላይ ስለ #dictionary ያየነዉ ይሄን ይመስላል : :



@h_programming
This media is not supported in your browser
VIEW IN TELEGRAM
ㅤㅤSet
--------------------

#set አንዱ የ python data type ሲሆን በዉስጡ የተለያዩ ሌሎች data type 'ኦችን ለማስቀመጥ ይጠቅማል : :

✔️ set በ curly brackets( {} ) የተከበበ ነዉ : :

ምሳሌ : -
{1, 2, 3}

✔️ በ አንድ set ዉስጥ ሁለት ተመሳሳይ element 'ኦች ሊኖሩ አይችሉም : :

ምሳሌ
x = {1, 2, 2}
print(x)

output :-
{1, 2}

✔️ #set mutable data type ነዉ : :

✔️ በ #set ዉስጥ የሚገኙ element 'ኦች immutable data type መሆን አለባቸዉ : :

ምሳሌ :-

{[1,2] , [3,4]} #wrong❌

❔ ምክንያቱም list mutable data type ስለሆነ የ set element መሆን አይችልም : :

{{"name":"sara"}, {"id":2}} #wrong❌

❔ ምክንያቱም dictionary mutable data type በመሆኑ የ set element መሆን አይችልም

{{1,2} , {3,4}} #wrong❌

❔ ምክንያቱም set mutable data type በመሆኒ የ #set element መሆን አይችልም : :

{1, 1.0, "1", (1, 2)} #correct ✅

❔int, float, string, tuple, እና ሌሎችም የ python immutable data type 'ኦች የ #set element መሆን ይችላሉ : :


@h_programming
🌐 ማጠቃለያ | python data type

እስካሁን ዋና ዋና እና ብዙ ጊዜ የምንጠቀምባቸዉ የ python data type 'ኦች ስናል ቆይተናል : :

አንዴ declare ከተደረጉ (ከተፈጠሩ በኋላ) መሻሻል ይችላሉ ወይስ አይችሉም የሚለዉን መሰረት በማረግ በ ሁለት ከፍለን ለማየት ሞክረናል : -

1⃣ mutable: ከተፈጠሩ በኋላ መስተካከል (modify) መሆን የሚችሉ የ python data type ናቸዉ : :

ምሳሌ : - List, Dictionary, Set

2⃣ immutable: እነዚ ደሞ አንዴ ከተፈጠሩ በኋላ መሻሻል የማይችሉ የ python data type 'ኦች ናቸዉ : :

ምሳሌ:- String, Integer, Float, Tuple



⚜ ስለ data type ለ ጊዜዉ በዚ እናበቃለን ወደፊት ግን አንዳንድ ተጨማሪ ነገሮችን የምናይ ይሆናል : :


@h_programming
This media is not supported in your browser
VIEW IN TELEGRAM
🐍 ስለ python data type እስካሁን የተማርነዉን ለማጠናከር ይሄንን video እንድትመለከቱ እመክራለሁ!

https://youtu.be/3z16g2oOxaQ

❤️ በዛዉም Subscribe እና like በማረግ ሌሎች የ python እና ከ technology ጋር የተገናኙ ትምህርቶችን ማግኘት ትችላላቹ !


@h_programming
CODE TECH™ (channel) pinned «🐍 ስለ python data type እስካሁን የተማርነዉን ለማጠናከር ይሄንን video እንድትመለከቱ እመክራለሁ! https://youtu.be/3z16g2oOxaQ ❤️ በዛዉም Subscribe እና like በማረግ ሌሎች የ python እና ከ technology ጋር የተገናኙ ትምህርቶችን ማግኘት ትችላላቹ ! @h_programming»
This media is not supported in your browser
VIEW IN TELEGRAM
Which error(s) occur during execution of this code?

try: print(1 / 0) except: raise ValueError
Anonymous Quiz
52%
ZeroDivisionError
19%
ValueError
19%
ZeroDivisionError, ValueError
10%
None
Which number is not printed by this code?

try: print(1) print(20 / 0) print(2) except ZeroDivisionError: print(3) finally: print (4)
Anonymous Quiz
7%
1
24%
2
7%
3
9%
4
11%
1, 2
11%
2, 3
4%
3, 4
27%
None
CODE TECH™ (channel)
Quiz በምንጠይቅበት ጊዜ
ጥሩ!
ለ #Quiz_4 ተዘጋጁ በቅርቡ ትፈተናላቹ : : 😊

ፈተናዉ የሚወጣዉ ከ #Quiz_3 እስካሁን በተማርናቸዉ ነገሮች ዙሪያ ይሆናል !

በነገራችን ላይ የራሳችሁን ጥያቄ አዉጥታችሁ መላክ ትችላላችሁ : : እኛም ጥያቄዎቻችሁን ሰብሰብ አርገን #quiz_4 ላይ አካተን የምናመጣቸዉ ይሆናል : :

ጥያቄዎችን ለመላክ @h_grambot ን ተጠቀሙ!



@h_programming
This media is not supported in your browser
VIEW IN TELEGRAM
1) ከሚከተሉት አንዱ 'escape sequence characters' አይደለም : : የቱ ነዉ ?
Anonymous Quiz
20%
\r
17%
\n
42%
\d
22%
\f
2) print("hello\tcoders" + "," + " hello coders\rselam") #የዚ code ዉጤት የሚሆነዉ...?
Anonymous Quiz
21%
hello\tcoders, hello coders\rselam
37%
hello coders, selam coders
19%
hello coders, hello coders
23%
hello coders, coders selam
3) ከሚከተሉት ዉስጥ ስህተት የሆነዉ የቱ ነዉ ?
Anonymous Quiz
12%
totalSum= 3
4%
total_sum = 3
4%
total_sum2 = 3
60%
total sum = 3
19%
_total = 3
4) print("10/5") #ዉጤት ?
Anonymous Quiz
13%
2
29%
2.0
48%
10/5
10%
error
6) print(3 ** 3)
Anonymous Quiz
41%
9
5%
6
54%
27
7) print(10 % 2)
Anonymous Quiz
57%
0
20%
5
23%
5.0