What is the results of the following code?
a = 1
a += 4
a -= 1
a *= 5
a /= 3
a //= 2
a %= 2
print(a)
Share button was made by: @auto_share_robot
a = 1
a += 4
a -= 1
a *= 5
a /= 3
a //= 2
a %= 2
print(a)
Share button was made by: @auto_share_robot
Rounding(ማጠጋጋት)
በ python float data type'ኦችን ለማጠጋጋት 'round()' የሚባል built-in function እንጠቀማለን : :
round() function ሁለት ዋና ዋና argument'ኦችን የሚቀበል ሲሆን የመጀመሪያዉ እንዲጠጋጋልን የምንፈልገዉ ቁጥር ሲሆን ሁለተኛዉ ደሞ እንዲጠጋጋልን የምንፈልገዉ በምን ይህል እንደሆነ የምንገልፅበት ነዉ : :
ለምሳሌ:-
1⃣
x = 2.6
y = round(x, 0)
print(y) #ዉጤት: 3.0
2⃣
x = 3.56
y = round(x, 1)
print(y) #ዉጤት: 3.6
3⃣
x = 8.243
y = round(x, 2)
print(y) #ዉጤት: 8.24
@h_programming
Share button was made by: @auto_share_robot
በ python float data type'ኦችን ለማጠጋጋት 'round()' የሚባል built-in function እንጠቀማለን : :
round() function ሁለት ዋና ዋና argument'ኦችን የሚቀበል ሲሆን የመጀመሪያዉ እንዲጠጋጋልን የምንፈልገዉ ቁጥር ሲሆን ሁለተኛዉ ደሞ እንዲጠጋጋልን የምንፈልገዉ በምን ይህል እንደሆነ የምንገልፅበት ነዉ : :
ለምሳሌ:-
1⃣
x = 2.6
y = round(x, 0)
print(y) #ዉጤት: 3.0
2⃣
x = 3.56
y = round(x, 1)
print(y) #ዉጤት: 3.6
3⃣
x = 8.243
y = round(x, 2)
print(y) #ዉጤት: 8.24
@h_programming
Share button was made by: @auto_share_robot
👍1
🎯 More On Operators
እስካሁን ሁለት የ python operator አይነቶች አይተናል, Arithmetic operators(+, -, *, /, //, %) እና assignment operator(=) : : አሁን ደሞ ከነሱ በተጨማሪ ሌሎች የ python operator አይነቶችን ለማየት እንሞክር...
📌 Comparison Operators
እነዚህ የ operator አይነቶች ሁለት ነገሮችን ለማወዳደር የሚጠቅሙ ናቸዉ : : እነሱም ...
🔹 greater than (>)
🔹 less than (<)
🔹 equals to (==)
🔹 greater than or equals to (>=)
🔹 less than or equals to (<=) እና
🔹 not equals to (!=)
...ናቸዉ : :
አገልግሎታቸዉ math ትምህርት ላይ ከምናዉቀዉ የተለየ አይደለም : :
ምሳሌዎች:-
1⃣
print(1 == 1)
#ውጤት:
True
👆 ከላይ ባለዉ code lay አንድ ከ አንድ ጋር እኩል ስለሆነ ወጤቱ True ሆኑአል : :
2⃣
print(1 == 2)
#ውጤት:-
False
3⃣
print(2 > 1)
#ውጤት:-
True
4⃣
print(1 > 2)
#ውጤት:-
False
5⃣
print(3 >= 3)
#ውጤት:-
True
6⃣
print(3 <= 3)
#ውጤት:-
True
7⃣
print(3 < 2)
#ውጤት:
False
8⃣
print(3 != 6)
#ዉጤት :-
True
9⃣
print(5 != 5)
#ዉጤት :-
False
ከምሳሌዎቹ ስለ Comparison Operators እንደተረዳችሁ ተስፋ እናረጋለን : :
Thanks for reading!
@h_programming
@h_programmers_group
Share button was made by: @auto_share_robot
እስካሁን ሁለት የ python operator አይነቶች አይተናል, Arithmetic operators(+, -, *, /, //, %) እና assignment operator(=) : : አሁን ደሞ ከነሱ በተጨማሪ ሌሎች የ python operator አይነቶችን ለማየት እንሞክር...
📌 Comparison Operators
እነዚህ የ operator አይነቶች ሁለት ነገሮችን ለማወዳደር የሚጠቅሙ ናቸዉ : : እነሱም ...
🔹 greater than (>)
🔹 less than (<)
🔹 equals to (==)
🔹 greater than or equals to (>=)
🔹 less than or equals to (<=) እና
🔹 not equals to (!=)
...ናቸዉ : :
አገልግሎታቸዉ math ትምህርት ላይ ከምናዉቀዉ የተለየ አይደለም : :
ምሳሌዎች:-
1⃣
print(1 == 1)
#ውጤት:
True
👆 ከላይ ባለዉ code lay አንድ ከ አንድ ጋር እኩል ስለሆነ ወጤቱ True ሆኑአል : :
2⃣
print(1 == 2)
#ውጤት:-
False
3⃣
print(2 > 1)
#ውጤት:-
True
4⃣
print(1 > 2)
#ውጤት:-
False
5⃣
print(3 >= 3)
#ውጤት:-
True
6⃣
print(3 <= 3)
#ውጤት:-
True
7⃣
print(3 < 2)
#ውጤት:
False
8⃣
print(3 != 6)
#ዉጤት :-
True
9⃣
print(5 != 5)
#ዉጤት :-
False
ከምሳሌዎቹ ስለ Comparison Operators እንደተረዳችሁ ተስፋ እናረጋለን : :
Thanks for reading!
@h_programming
@h_programmers_group
Share button was made by: @auto_share_robot
write a python program which takes two inputs as a prompt and prints True if the first input is greater than the second, False else.
Share button was made by: @auto_share_robot
Share button was made by: @auto_share_robot
CODE TECH™ (channel)
write a python program which takes two inputs as a prompt and prints True if the first input is greater than the second, False else. Share button was made by: @auto_share_robot
num1 = int(input("enter the first number"))
num2 = int(input("enter the second number"))
print(num1>num2)
num2 = int(input("enter the second number"))
print(num1>num2)
👍1
CODE TECH™ (channel)
Next »» 📌 Logical Operators
📌 Logical Operators
በ python 3 አይነት Logical operator 'ኦች ሲኖሩ እነሱም:-
🔹 not
🔹 or እና
🔹 and
...ናቸዉ : :
🔑 Logical operator'ኦች boolean data type'ኦችን operate ለማረግ ነዉ የምንጠቀምባቸዉ : :
🤔 ግን Boolean data type ምንድነዉ ?
እስካሁን እንዳየናቸዉ የ python data type'ኦች ማለትም እንደ integer, string, tuple, list, dictionary, set ሁሉ boolean 'ም የ python የ data አይነት ሲሆኑ እነሱም True እና False ናቸዉ : : ለምሳሌ Comparison Operators ተጠቅመን ሁለት ቁጥሮችን operate ስናረግ የምናገኘዉ boolean data type ያላቸዉን ዉጤቶችን ነዉ ማለትም True ወይም False 'ን...
1⃣ The Logical Operator "and"
'and' ከ ሶስቱ Logical Operator'ኦች አንዱ ነዉ : : 'and' ተጠቅመን ሁለት boolean 'ኦችን ወደ አንድ boolean መቀየር እንችላለን : : ሁለቱ boolean 'ኦች ወደ አንድ ሲቀየሩ True ሊሰጡ የሚችሉት ሁለቱም True ከሆኑ ብቻ ነዉ : :
ምሳሌዎች:-
print(True and False)
#👆ውጤት 👇:
False
---------------------------------------------
print(False and True)
#👆ዉጤት👇:
False
---------------------------------------------
print(False and False)
#👆ውጤት 👇:
False
---------------------------------------------
print(True and True)
#👆ውጤት 👇:
True
ይቀጥላል.....
✍ @h_programming ✍
Share button was made by: @auto_share_robot
በ python 3 አይነት Logical operator 'ኦች ሲኖሩ እነሱም:-
🔹 not
🔹 or እና
🔹 and
...ናቸዉ : :
🔑 Logical operator'ኦች boolean data type'ኦችን operate ለማረግ ነዉ የምንጠቀምባቸዉ : :
🤔 ግን Boolean data type ምንድነዉ ?
እስካሁን እንዳየናቸዉ የ python data type'ኦች ማለትም እንደ integer, string, tuple, list, dictionary, set ሁሉ boolean 'ም የ python የ data አይነት ሲሆኑ እነሱም True እና False ናቸዉ : : ለምሳሌ Comparison Operators ተጠቅመን ሁለት ቁጥሮችን operate ስናረግ የምናገኘዉ boolean data type ያላቸዉን ዉጤቶችን ነዉ ማለትም True ወይም False 'ን...
1⃣ The Logical Operator "and"
'and' ከ ሶስቱ Logical Operator'ኦች አንዱ ነዉ : : 'and' ተጠቅመን ሁለት boolean 'ኦችን ወደ አንድ boolean መቀየር እንችላለን : : ሁለቱ boolean 'ኦች ወደ አንድ ሲቀየሩ True ሊሰጡ የሚችሉት ሁለቱም True ከሆኑ ብቻ ነዉ : :
ምሳሌዎች:-
print(True and False)
#👆ውጤት 👇:
False
---------------------------------------------
print(False and True)
#👆ዉጤት👇:
False
---------------------------------------------
print(False and False)
#👆ውጤት 👇:
False
---------------------------------------------
print(True and True)
#👆ውጤት 👇:
True
ይቀጥላል.....
✍ @h_programming ✍
Share button was made by: @auto_share_robot
print(1 > 2 and 1 < 2)
Anonymous Quiz
10%
1 > 2 and 1 < 2
4%
1 > 2 1 < 2
12%
True
56%
False
12%
Error
6%
None
CODE TECH™ (channel)
print(1 > 2 and 1 < 2)
This media is not supported in your browser
VIEW IN TELEGRAM
1 > 2 and 1 < 2
👆 ይህ ማለት 👇
False and True ...ነዉ : :
👆 ይህ ማለት ደሞ 👇
False ...ነው : :
ስለዚህ መልሱ False ነዉ : :
Share button was made by: @auto_share_robot
👆 ይህ ማለት 👇
False and True ...ነዉ : :
👆 ይህ ማለት ደሞ 👇
False ...ነው : :
ስለዚህ መልሱ False ነዉ : :
Share button was made by: @auto_share_robot
CODE TECH™ (channel)
print("a" > "A")
❓ እንዴት "a" ከ "A" ሊበልጥ ቻለ 🤔
💡 string data type'ኦችን በ “Comparison Operators” ተጠቅመን ስናወዳድር python የሚያወዳድረዉ ፊደሎቹን ሳይሆን የተወከሉበትን “ASCII” code ነዉ : :
❔ ግን “ASCII” code ምንድነዉ ? 🤔
🌀 ASCII(American Standard Code for Information Interexchange) - ማለት በ computer ውስጥ የተለያዩ letters, numbers, characters, and symbols የሚወክል ቁጥር ነዉ : : እያንዳንዱ ፊደል(character) የተወከለበት የተለያየ ASCII code አለዉ : : ለምሳሌ የ "C" ASCII code 67 ነዉ : :
🌀 በ python የ letters, numbers, characters, and symbols 'ን ASCII code ማወቅ ከፈለግን ord() function 'ን እንጠቀማለን --- ord("C") --- ይህም የ "C" ን ASCII CODE ይሰጠኛል : :
ውጤት :-
🌀 ASCII CODE 'ኡን መልሰን ወደ character ለመቀየር ከፈለግን ደሞ --- chr() 'ን እንጠቀማለን :-
character = chr(67)
print(character)
ውጤት :-
C
🌀 ወደ ጥያቄዉ ስመለስ "a" ከ "A" የበለጠበት ምክንያት የ "a" ASCII code ከ "A" ስለሚበልጥ ነዉ : : እስኪ ord() function 'ን ተጠቅመን ምን ያህል እንደሚበላለጡ እንይ....
ascii_a = ord("a")
ascii_A = ord("A")
print("የ 'a' ASCII code:", ascii_a)
print("የ 'A' ASCII code:", ascii_A)
ውጤቱ:-
የ 'a' ASCII code: 97
የ 'A' ASCII code: 65
You see?! 🙄😉
Thanks for reading!
✍ @h_programming
Share button was made by: @auto_share_robot
💡 string data type'ኦችን በ “Comparison Operators” ተጠቅመን ስናወዳድር python የሚያወዳድረዉ ፊደሎቹን ሳይሆን የተወከሉበትን “ASCII” code ነዉ : :
❔ ግን “ASCII” code ምንድነዉ ? 🤔
🌀 ASCII(American Standard Code for Information Interexchange) - ማለት በ computer ውስጥ የተለያዩ letters, numbers, characters, and symbols የሚወክል ቁጥር ነዉ : : እያንዳንዱ ፊደል(character) የተወከለበት የተለያየ ASCII code አለዉ : : ለምሳሌ የ "C" ASCII code 67 ነዉ : :
🌀 በ python የ letters, numbers, characters, and symbols 'ን ASCII code ማወቅ ከፈለግን ord() function 'ን እንጠቀማለን --- ord("C") --- ይህም የ "C" ን ASCII CODE ይሰጠኛል : :
ascii = ord("C")
print(ascii)ውጤት :-
67🌀 ASCII CODE 'ኡን መልሰን ወደ character ለመቀየር ከፈለግን ደሞ --- chr() 'ን እንጠቀማለን :-
character = chr(67)
print(character)
ውጤት :-
C
🌀 ወደ ጥያቄዉ ስመለስ "a" ከ "A" የበለጠበት ምክንያት የ "a" ASCII code ከ "A" ስለሚበልጥ ነዉ : : እስኪ ord() function 'ን ተጠቅመን ምን ያህል እንደሚበላለጡ እንይ....
ascii_a = ord("a")
ascii_A = ord("A")
print("የ 'a' ASCII code:", ascii_a)
print("የ 'A' ASCII code:", ascii_A)
ውጤቱ:-
የ 'a' ASCII code: 97
የ 'A' ASCII code: 65
You see?! 🙄😉
Thanks for reading!
✍ @h_programming
Share button was made by: @auto_share_robot
👍2
Posting anything bout coding that helps us go forward into our near future And we will do from the beginning to the end
-- make a website
-- make a bot by coding
-- make an AI like siri and more
👉 https://t.me/StillCoding
-- make a website
-- make a bot by coding
-- make an AI like siri and more
👉 https://t.me/StillCoding
Telegram
Let's Program💯
Posting anything bout coding that helps us go forward into our near future And we will do from the beginning to the end
-- make a website
-- make a bot by coding
-- make an AI like siri and more
-- make a website
-- make a bot by coding
-- make an AI like siri and more
CODE TECH™ (channel)
📌 Logical Operators በ python 3 አይነት Logical operator 'ኦች ሲኖሩ እነሱም:- 🔹 not 🔹 or እና 🔹 and ...ናቸዉ : : 🔑 Logical operator'ኦች boolean data type'ኦችን operate ለማረግ ነዉ የምንጠቀምባቸዉ : : 🤔 ግን Boolean data type ምንድነዉ ? እስካሁን እንዳየናቸዉ የ python data type'ኦች…
2⃣ The logical operator "or"
"or" ሌላኛዉ የ logical operator ምሳሌ ሲሆን ሁለት logical statement'ኦችን ለማያያዝ እንጠቀምበታለን : : አገልግሎቱም Math ትምህርት ላይ ከተማርነዉ ጋር አንድ አይነት ነዉ : : በ "or" አማካኝነት ከተያያዙት ሁለቱ statement'ኦች ቢያንስ አንደኛዉ True ከሆነ ሙሉ statement'ኡ True ይሆናል : :
✨ ለምሳሌ:-
print(True or False)
ውጤት:-
True
print(False or True)
ውጤት:-
True
print(True or True)
ውጤት :-
True
print(False or False)
ውጤት:-
False
🔜 Next » The logical operator "not"
💁♂ በራሳችሁ እየፃፋችሁ run በማረግ መማር, ዉጤቱን አይታችሁ የፃፋችሁት code ምን እንደሚሰራ መገመት, ከተማራችሁት ነገር ተነስታችሁ የራሳችሁን ፈጠራ መጨመር(መፈላሰፍ)... ማድረግ ያሉብን ነገሮች ናቸው programming language ስንማር...
~~~~~~~~~
✍ @h_programming
👥 @h_programmers_grouo
📥 @h_grambot
"or" ሌላኛዉ የ logical operator ምሳሌ ሲሆን ሁለት logical statement'ኦችን ለማያያዝ እንጠቀምበታለን : : አገልግሎቱም Math ትምህርት ላይ ከተማርነዉ ጋር አንድ አይነት ነዉ : : በ "or" አማካኝነት ከተያያዙት ሁለቱ statement'ኦች ቢያንስ አንደኛዉ True ከሆነ ሙሉ statement'ኡ True ይሆናል : :
✨ ለምሳሌ:-
print(True or False)
ውጤት:-
True
print(False or True)
ውጤት:-
True
print(True or True)
ውጤት :-
True
print(False or False)
ውጤት:-
False
🔜 Next » The logical operator "not"
💁♂ በራሳችሁ እየፃፋችሁ run በማረግ መማር, ዉጤቱን አይታችሁ የፃፋችሁት code ምን እንደሚሰራ መገመት, ከተማራችሁት ነገር ተነስታችሁ የራሳችሁን ፈጠራ መጨመር(መፈላሰፍ)... ማድረግ ያሉብን ነገሮች ናቸው programming language ስንማር...
~~~~~~~~~
✍ @h_programming
👥 @h_programmers_grouo
📥 @h_grambot
❤1
3⃣ The logical operator "not"
ይህ የ logical operator አይነት የአንድን logical statement Truth value ለመቀየር የምንጠቀምበት ነዉ : : ያህም ማለት False የነበረውን ወደ True...True የነበረውን ወደ False ይቀይራል : :
❔ በነገራችን ላይ Logical statement ማለት True ወይም False ልንለው የምንችለዉ statement ማለት ነው : :
ለምሳሌ:
1 > 3
2 < 3
5 == 5
7 >= 6
21 <= 13
42 != 21
.
.
.
Logical statement'ኦች ናቸዉ : :
💡 logical statement'ኦች በ programming ዉስጥ boolean expressions ተብለዉ ይጠራሉ : :
🎯 ስለዚ ከላይ እንዳልነዉ logical operator "not" 'ን በመጠቀም የአንድን boolean expression Truth value ወደ ተቃራኒዉ መቀየር እንችላለን : :
✨ ምሳሌ :-
ውጤት : -
ውጤት : -
~~~~~
✍ @h_programming
👥 @h_programmers_group
📥 @h_grambot
ይህ የ logical operator አይነት የአንድን logical statement Truth value ለመቀየር የምንጠቀምበት ነዉ : : ያህም ማለት False የነበረውን ወደ True...True የነበረውን ወደ False ይቀይራል : :
❔ በነገራችን ላይ Logical statement ማለት True ወይም False ልንለው የምንችለዉ statement ማለት ነው : :
ለምሳሌ:
1 > 3
2 < 3
5 == 5
7 >= 6
21 <= 13
42 != 21
.
.
.
Logical statement'ኦች ናቸዉ : :
💡 logical statement'ኦች በ programming ዉስጥ boolean expressions ተብለዉ ይጠራሉ : :
🎯 ስለዚ ከላይ እንዳልነዉ logical operator "not" 'ን በመጠቀም የአንድን boolean expression Truth value ወደ ተቃራኒዉ መቀየር እንችላለን : :
✨ ምሳሌ :-
print(not True)ውጤት : -
Falseprint(not False)ውጤት : -
True✍ @h_programming
👥 @h_programmers_group
📥 @h_grambot
👍2❤1