ማንኛዉንም አይነት የ telegram bot ማሰራት ለምትፈልጉ python programming language ን ተጠቅመን እንሰራለን : :
ከዚ ቀደም በኛ የተሰሩ ቦቶች:
@hahu_robot
@auto_share_robot
ከናንተ ሚጠበቀዉ እንዲሰራላችሁ የምትፈልጉትን ቦት በደንብ ለኛ ማስረዳት ነዉ : :
እኛ ለማግኘት @h_grambot 'ን ይጠቀሙ : :
ከዚ ቀደም በኛ የተሰሩ ቦቶች:
@hahu_robot
@auto_share_robot
ከናንተ ሚጠበቀዉ እንዲሰራላችሁ የምትፈልጉትን ቦት በደንብ ለኛ ማስረዳት ነዉ : :
እኛ ለማግኘት @h_grambot 'ን ይጠቀሙ : :
ተቋርጦ የነበረዉ የ python ትምህርት በቅርቡ ይጀምራል...እስኪ እንደምትከታተሉን እና ያላችሁን ድጋፍ ‘like’ በማረግ አሳዩን
✅ እንዴት በአንድ ጊዜ አንድን literal ከአንድ በላይ ለሆኑ identifier 'ኦች assign እናረጋለን ?
ለምሳሌ:
1 ቁጥርን በ x, y, z identifiers ላይ assign ማድረግ ብፈልግ:
#code_1
ይህንኑ ግን በቀላሉ ለመስራት:
#code_2
በአንድ መስመር ብቻ 😋
🎯 ሁለቱም code'ኦች ተመሳሳይ ስራ ሚሠሩ ሲሆን ግልፅና አጭር የሆነው ግን #code_2 ነው።
☣️ ሁሌም ቢሆን code ስንፅፍ መስራቱን ብቻ ሳይሆን አጭር እና ግልፅ ለማድረግም መጣር አለብን።
🕒 እሱ ብቻ ሳይሆን run ሲደረግ የሚወስድበትን ጊዜም በተቻለን መጠን ለማሳነስ መሞከር አለብን።
🎈 ይህ program'አችንን ትንሽ size ያለው እና ፈጣን በመሆኑ በተጠቃሚዎች ተመራጭ ይሆናል።
💡 ለምሳሌ አለም ላይ ብዙ አይነት search engines አሉ... Yahoo, Duck Duck go, Google.... ነገር ግን በብዙ ሰዎች ተመራጭ የሆነዉ Google ነው። Google'ን ተመራጭ ያደረጉት ብዙ ምክንያቶች ቢኖሩም ፍጥነቱ ግን ዋነኛው ነው።
💠 ስለዚህ ሁልጊዜም ከላይ ያሳየኋችሁ አይነት ዘዴዎችን በመጠቀም program'አችንን ተመራጭ ለማድረግ መጣር አለብን።
🙏Thanks for reading!
✍️ @h_programming ✍️
Share button was made by: @auto_share_robot
ለምሳሌ:
1 ቁጥርን በ x, y, z identifiers ላይ assign ማድረግ ብፈልግ:
#code_1
x = 1
y = 1
z = 1ይህንኑ ግን በቀላሉ ለመስራት:
#code_2
x = y = z = 1በአንድ መስመር ብቻ 😋
🎯 ሁለቱም code'ኦች ተመሳሳይ ስራ ሚሠሩ ሲሆን ግልፅና አጭር የሆነው ግን #code_2 ነው።
☣️ ሁሌም ቢሆን code ስንፅፍ መስራቱን ብቻ ሳይሆን አጭር እና ግልፅ ለማድረግም መጣር አለብን።
🕒 እሱ ብቻ ሳይሆን run ሲደረግ የሚወስድበትን ጊዜም በተቻለን መጠን ለማሳነስ መሞከር አለብን።
🎈 ይህ program'አችንን ትንሽ size ያለው እና ፈጣን በመሆኑ በተጠቃሚዎች ተመራጭ ይሆናል።
💡 ለምሳሌ አለም ላይ ብዙ አይነት search engines አሉ... Yahoo, Duck Duck go, Google.... ነገር ግን በብዙ ሰዎች ተመራጭ የሆነዉ Google ነው። Google'ን ተመራጭ ያደረጉት ብዙ ምክንያቶች ቢኖሩም ፍጥነቱ ግን ዋነኛው ነው።
💠 ስለዚህ ሁልጊዜም ከላይ ያሳየኋችሁ አይነት ዘዴዎችን በመጠቀም program'አችንን ተመራጭ ለማድረግ መጣር አለብን።
🙏Thanks for reading!
✍️ @h_programming ✍️
Share button was made by: @auto_share_robot
🎯 Augmented assignment operators
number = 1
number = number + 1
Augmented assignment operators የምንላቸዉ ከላይ የሚታየዉ code አይነት ስራዎችን በ በአጭሩ ለመስራት የሚጠቅሙ አቋራጭ መንገዶች ናቸዉ : :
ከላይ የተፃፈዉን code Augmented assignment operator ተጠቅሜ ስፅፈዉ ...
number = 1
number += 1
... ይሆናል::
ሁለቱም ተመሳሳይ ስራ ቢሰሩም ሁለተኛዉ ግን የበለጠ ተነባቢ እና አጭር ነዉ : :
ሌሎች ምሳሌዎች :-
1⃣
x = 3
x = x - 1
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 1
x -= 1
------------------------------------------
2⃣
x = 5
x = x * 5
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 5
x *= 5
------------------------------------------
3⃣
x = 2
x = x ** 3
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 2
x **= 3
----------------------------------------
4⃣
x = 20
x = x // 2
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x //= 2
------------------------------------------
5⃣
x = 20
x = x / 2
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x /= 2
6⃣
x = 20
x = x % 3
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x %= 3
@h_programming
Share button was made by: @auto_share_robot
number = 1
number = number + 1
Augmented assignment operators የምንላቸዉ ከላይ የሚታየዉ code አይነት ስራዎችን በ በአጭሩ ለመስራት የሚጠቅሙ አቋራጭ መንገዶች ናቸዉ : :
ከላይ የተፃፈዉን code Augmented assignment operator ተጠቅሜ ስፅፈዉ ...
number = 1
number += 1
... ይሆናል::
ሁለቱም ተመሳሳይ ስራ ቢሰሩም ሁለተኛዉ ግን የበለጠ ተነባቢ እና አጭር ነዉ : :
ሌሎች ምሳሌዎች :-
1⃣
x = 3
x = x - 1
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 1
x -= 1
------------------------------------------
2⃣
x = 5
x = x * 5
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 5
x *= 5
------------------------------------------
3⃣
x = 2
x = x ** 3
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 2
x **= 3
----------------------------------------
4⃣
x = 20
x = x // 2
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x //= 2
------------------------------------------
5⃣
x = 20
x = x / 2
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x /= 2
6⃣
x = 20
x = x % 3
Augmented assignment operators ተጠቅመን ስንፅፈው :
x = 20
x %= 3
@h_programming
Share button was made by: @auto_share_robot
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