Python Pioneers: A Beginner's Guide 🇪🇹
Открыть в Telegram
Welcome to Python Pioneers: Empowering Ethiopian students to embark on their coding journey. 📢 Channel: @python_pioneers 👥 Group: @python_pioneers_com
Больше8 874
Подписчики
Нет данных24 часа
-277 дней
-13630 дней
Архив постов
The Weight of the Glass
Once upon a time a psychology professor walked around on a stage while teaching stress management principles to an auditorium filled with students. As she raised a glass of water, everyone expected they’d be asked the typical “glass half empty or glass half full” question. Instead, with a smile on her face, the professor asked, “How heavy is this glass of water I’m holding?”
Students shouted out answers ranging from eight ounces to a couple pounds.
She replied, “From my perspective, the absolute weight of this glass doesn’t matter. It all depends on how long I hold it. If I hold it for a minute or two, it’s fairly light. If I hold it for an hour straight, its weight might make my arm ache a little. If I hold it for a day straight, my arm will likely cramp up and feel completely numb and paralyzed, forcing me to drop the glass to the floor. In each case, the weight of the glass doesn’t change, but the longer I hold it, the heavier it feels to me.”
As the class shook their heads in agreement, she continued, “Your stresses and worries in life are very much like this glass of water. Think about them for a while and nothing happens. Think about them a bit longer and you begin to ache a little. Think about them all day long, and you will feel completely numb and paralyzed – incapable of doing anything else until you drop them.”
The moral: It’s important to remember to let go of your stresses and worries. No matter what happens during the day, as early in the evening as you can, put all your burdens down. Don’t carry them through the night and into the next day with you. If you still feel the weight of yesterday’s stress, it’s a strong sign that it’s time to put the glass down#EnglishStory @python_pioneers
26 авг. 2024, 14:59
while True:
user_guess = int(input("Make a guess: "))
if user_guess == rand_num:
print("Congrats, you got the number!")
break
elif user_guess > max or user_guess < min:
print("Your guess is out of range!")
break
elif user_guess > rand_num:
print("You are above the number, make a lower guess.")
elif user_guess < rand_num:
print("You are below the number, make a higher guess.")
else:
print("Wrong Input!")
break
no_of_guesses += 1
- The program enters an infinite loop using while True: where the user is repeatedly prompted to guess the number.
- Checking if the Guess is Correct:
Userኡ ያስገባው ቁጥር ከ random numberኡ ጋር እኩል ከሆነ "Congrats, ..." የሚለው message printed ይሆናል።
- Checking for Out-of-Range Guesses:
Userኡ ያስገባው ቁጥር specified ከሆነው range ውጪ ከሆነ loopኡ ይቆማል።
- Providing Hints:
- If the guess is higher than the random number, the user is informed and asked to guess a lower number.
- If the guess is lower than the random number, the user is informed and asked to guess a higher number.
- Incrementing the Guess Counter:
After each guess, the no_of_guesses counter is incremented by 1 to track the number of attempts.
#GuessGame
@python_pioneers24 авг. 2024, 13:36
Number guessing game በPython ይሄን ይመስላል፣ እያንዳንዱን የcodeኡን section እስቲ እንይ፣
1. Importing the
random module:
import random
- `random moduleን import ያረግነው set ባረግነው range ገደብ random ቁጥር እንዲሰጠን ነው።
2. User Input for the Range:
min = int(input("Minimum number for your guess range: "))
max = int(input("Maximum number for your guess range: "))
Gameኡን የሚጫወቱው ሰው ለguessing range minimum እና maximum value እንዲመርጥ እንጠይቀዋለን። ከዛ የተቀበልነውን string data type int() function በመጠቀም ወደ integerነት እንቀይረዋለን።
3. Generating a Random Number:
rand_num = random.randint(min, max)
በዚህ section ደግሞ random number generate እንዲያረግልን import ያረግነውን module ተጠቅመናል:
Using random.randint()
4. Initializing the Guess Counter:
no_of_guesses = 0
እዚህ ደግሞ userኡ ምን ያህል ጊዘ እንደገመተ የምንቆጣጠርበትን variable declare አርገናል፣ initial value ደግሞ zero ሰጥተንዋል።
#GuessGame
@python_pioneers24 авг. 2024, 13:34
Number guessing game በPython ይሄን ይመስላል፣ እያንዳንዱን የcodeኡን section እስቲ እንይ፣
1. Importing the
random module:
import random
- `random moduleን import ያረግነው set ባረግነው range ገደብ random ቁጥር እንዲሰጠን ነው።
2. User Input for the Range:
``python
min = int(input("Minimum number for your guess range: "))
max = int(input("Maximum number for your guess range: "))
Gameኡን የሚጫወቱው ሰው ለguessing range minimum እና maximum value እንዲመርጥ እንጠይቀዋለን። ከዛ የተቀበልነውን string data type int() function በመጠቀም ወደ integerነት እንቀይረዋለን። 3. Generating a Random Number:python rand_num = random.randint(min, max)
በዚህ section ደግሞ random number generate እንዲያረግልን import ያረግነውን module ተጠቅመናል: Using `random.randint()` 4. Initializing the Guess Counter:python no_of_guesses = 0
እዚህ ደግሞ userኡ ምን ያህል ጊዘ እንደገመተ የምንቆጣጠርበትን variable declare አርገናል፣ initial value ደግሞ zero ሰጥተንዋል። 5. The Guessing Loop:python while True: user_guess = int(input("Make a guess: ")) if user_guess == rand_num: print("Congrats, you got the number!") break elif user_guess > max or user_guess < min: print("Your guess is out of range!") break elif user_guess > rand_num: print("You are above the number, make a lower guess.") elif user_guess < rand_num: print("You are below the number, make a higher guess.") else: print("Wrong Input!") break no_of_guesses += 1
`24 авг. 2024, 13:33
24 авг. 2024, ~13:33
Number guessing game በPython ይሄን ይመስላል፣ እያንዳንዱን የcodeኡን section እስቲ እንይ፣
1. Importing the
random module:
import random
- `random moduleን import ያረግነው set ባረግነው range ገደብ random ቁጥር እንዲሰጠን ነው።
2. User Input for the Range:
``python
min = int(input("Minimum number for your guess range: "))
max = int(input("Maximum number for your guess range: "))
Gameኡን የሚጫወቱው ሰው ለguessing range minimum እና maximum value እንዲመርጥ እንጠይቀዋለን። ከዛ የተቀበልነውን string data type int() function በመጠቀም ወደ integerነት እንቀይረዋለን። 3. Generating a Random Number:python rand_num = random.randint(min, max)
በዚህ section ደግሞ random number generate እንዲያረግልን import ያረግነውን module ተጠቅመናል: Using `random.randint()` 4. Initializing the Guess Counter:python no_of_guesses = 0
እዚህ ደግሞ userኡ ምን ያህል ጊዘ እንደገመተ የምንቆጣጠርበትን variable declare አርገናል፣ initial value ደግሞ zero ሰጥተንዋል። 5. The Guessing Loop:python while True: user_guess = int(input("Make a guess: ")) if user_guess == rand_num: print("Congrats, you got the number!") break elif user_guess > max or user_guess < min: print("Your guess is out of range!") break elif user_guess > rand_num: print("You are above the number, make a lower guess.") elif user_guess < rand_num: print("You are below the number, make a higher guess.") else: print("Wrong Input!") break no_of_guesses += 1
`
- The program enters an infinite loop using `while True:` where the user is repeatedly prompted to guess the number.
- Checking if the Guess is Correct:
Userኡ ያስገባው ቁጥር ከ random numberኡ ጋር እኩል ከሆነ "Congrats, ..." የሚለው message printed ይሆናል።
- Checking for Out-of-Range Guesses:
Userኡ ያስገባው ቁጥር specified ከሆነው range ውጪ ከሆነ loopኡ ይቆማል።
- Providing Hints:
- If the guess is higher than the random number, the user is informed and asked to guess a lower number.
- If the guess is lower than the random number, the user is informed and asked to guess a higher number.
- Incrementing the Guess Counter:
After each guess, the `no_of_guesses` counter is incremented by 1 to track the number of attempts.24 авг. 2024, 13:32
24 авг. 2024, ~13:32
ትላንት ባልነው መሠረት here is our simple number guessing game python code.
ስለ codeኡ አሰራር ከስር እንጽፋለን...
#Game
#GuessGame
@python_pioneers
24 авг. 2024, 13:04
Tomorrow, we will be building a simple Python number guessing game to ensure you gain deep and applicable knowledge from what you're learning.
#NumberGuessingGame
@python_pioneers
23 авг. 2024, 13:46
Tuple የምንፈጥርባቸው ብዙ መንገዶች አሉ ፣ like
1. By using tuple() function
2. By manually inserting the elements inside a parenthesis
ለምሳሌ :
my_tuple = ("Monday", "Tuesday" "Wednesday")
ወይም range function inside tuple function በመጠቀም a tuple of numbers መፍጠር እንችላለን።
የTuple ጥቅሞች ውስጥ packing እና unpacking ትልቁን ድርሻ ይወስዳሉ።
Packing
We can create a tuple by packing a group of variables.
Syntax :
tuple_name = elements
ለምሳሌ :
a, b, c, d = 10, 20, 30, 40
my_tuple = a, b, c, d
print(my_tuple)
#Output: (10, 20, 30, 40)
Unpacking
Tuple unpacking is the reverse process of tuple packing, we can unpack a tuple and assign its values to different variables.
Syntax :
elements = tuple_name
ለምሳሌ :
my_tuple = (10, 20, 30, 40)
a, b, c, d = my_tuple
print(" a =", a, " b =", b, " c =", c, " d =", d)
#Output : a = 10 b = 20 c = 30 d = 40
Tuple unpacking በመጠቀም multiple variables በአንድ ጊዜ declare ማድረግ እንችላለን።
#Tuple
@python_pioneers23 авг. 2024, 12:50
ደህና ዋላችሁ ቤተሰቦች!
ዛሬ ችግኝ ተከላችሁ ወይ?
23 авг. 2024, 11:37
✓ Which of the following statements correctly describes a tuple in Python?
22 авг. 2024, 14:57
Difference between Tuple and List
@python_pioneers
22 авг. 2024, 14:44
Difference between Tuple and List
@bale_helm
22 авг. 2024, 14:44
22 авг. 2024, ~14:44
What are Tuples?Tuple በpython የobjects ስብስብ ሲሆን ባለፈው እንደተማርነው we can't change the order of the items in it. Objectኦቹ strings, lists, tuples, integers etc. ሊሆኑ ይችላሉ። የTuple insertion characteristics preserved ነው፣ once elements ካስቀመጥን we can't modify them. Elements ከtuple የምናገኘው መጀመሪያ ባስቀመጥንበት order ነው። Immutable: Once if we create a tuple object, then we cannot modify the content of the tuple object. ከlist የሚለያቸው ነገር ቢኖር ይህ ነው ፡ immutable መሆናቸው። Tuple duplicate data store ማረግ ይችላል unlike set. Tuple ተመሳሳይም ሆነ የተለያየ data type store ያረጋሉ እንደ list ማለት ነው to be cont'd... #Tuple @python_pioneers
22 авг. 2024, 14:31
Repost from Abiy Ahmed Ali 🇪🇹
+1
በዲጂታል ኢትዮጵያ ጉዞ አንድ እመርታ የታየበት ደረጃ ላይ ደርሰናል። ኢትዮ ቴሌኮም ከቪዛ ኩባንያ ጋር በመተባበር በኢትዮዽያ የመጀመሪያውን በኪስ የሚያዝ 'ቨርቱዋል ቪዛ' ካርድ ብሎም የተሻሻለ የሀዋላ አገልግሎት በቪዛ ዳይሬክት እና በቴሌብር ረሚት አቅርቧል።
ቪዛ ዳይሬክት ከ190 ሀገራት በላይ ቀለል ያለ የገንዘብ ማዘዋወር አገልግሎትን በቴሌብር ቨርቱዋል ካርድ ቁጥር አማካኝነት የሚያቀላጥፍ ይሆናል። ይህ አዲስ አገልግሎት ከ47.55 ሚሊዮን በላይ የሆኑ የቴሌብር ተጠቃሚዎችን ያገለግላል። ኢትዮ ቴሌኮም ትልቅ ስራ ሰርቷል።
A significant milestone in our Digital Ethiopia journey has been achieved with Ethio telecom, in partnership with Visa Inc., launching the country's first wallet-based Virtual Visa Card and enhanced remittance services via Visa Direct and telebirr Remit.
Visa Direct facilitates easy money transfers to Ethiopia from over 190 countries using a telebirr virtual card number. This partnership supports over 47.55 million telebirr users and advances Ethiopia's digital financial services. Well done to EthioTelecom!
20 авг. 2024, 03:50
Memory of the past
This was our first post, at the time there were only 69 subscribers, but now there are so many ppl, who also become part of this family 🥰
ሁላችሁንም ስለ አብሮነታችሁ፣ የጉዟችን አካል ስለሆናችሁ እናመሰግናለን!
@python_pioneers
19 авг. 2024, 14:17
