Forwarded from Abiy Ahmed Ali ๐ช๐น
แ แฒแแณแ แขแตแฎแตแซ แแ แ แแต แฅแแญแณ แจแณแจแ แต แฐแจแ แแญ แฐแญแฐแแแข แขแตแฎ แดแแฎแ แจแชแ แฉแฃแแซ แแญ แ แแฐแฃแ แญ แ แขแตแฎแฝแซ แจแแแแชแซแแ แ แชแต แจแแซแ 'แจแญแฑแแ แชแ' แซแญแต แฅแแ แจแฐแปแปแ แจแแแ แ แแแแแต แ แชแ แณแญแฌแญแต แฅแ แ แดแแฅแญ แจแแต แ แ
แญแงแแข
แชแ แณแญแฌแญแต แจ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!
แชแ แณแญแฌแญแต แจ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!
๐1
Let's have some fun๐
๐คฃ4
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 แแแข
แจlist แจแแแซแธแ แแแญ แขแแญ แญแ แแ แก immutable แแแแธแแข
Tuple duplicate data store แแจแ แญแฝแแ unlike set.
Tuple แฐแแณแณแญแ แแ แจแฐแแซแจ data type store แซแจแแ แฅแแฐ list แแแต แแ
to be cont'd...
#Tuple
@python_pioneers
๐4
โ Which of the following statements correctly describes a tuple in Python?
Anonymous Quiz
9%
A) Tuples are mutable and can have their elements changed after creation.
75%
B) Tuples are immutable, meaning their elements cannot be changed after creation.
9%
C) Tuples are mutable, but their length is fixed once created.
7%
D) Tuples are immutable, but their elements can be changed.
๐1
แฐแ
แ แแแฝแ แคแฐแฐแฆแฝ!
แแฌ แฝแแ แฐแจแแฝแ แแญ?
แแฌ แฝแแ แฐแจแแฝแ แแญ?
Anonymous Poll
14%
แ แ
86%
แ แญ
Tuple แจแแแแฅแญแฃแธแ แฅแ แแแแถแฝ แ แ แฃ like
1. By using tuple() function
2. By manually inserting the elements inside a parenthesis
แแแณแ :
แแญแ range function inside tuple function แ แแ แแ a tuple of numbers แแแ แญ แฅแแฝแแแแข
แจTuple แฅแ แแฝ แแตแฅ packing แฅแ unpacking แตแแแ แตแญแป แญแแตแณแแข
Packing
We can create a tuple by packing a group of variables.
แแแณแ :
Unpacking
Tuple unpacking is the reverse process of tuple packing, we can unpack a tuple and assign its values to different variables.
แแแณแ :
Tuple unpacking แ แแ แแ multiple variables แ แ แแต แแ declare แแตแจแ แฅแแฝแแแแข
#Tuple
@python_pioneers
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_pioneers
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
#NumberGuessingGame
@python_pioneers
Media is too big
VIEW IN TELEGRAM
แตแแแต แฃแแแ แแ แจแต here is our simple number guessing game python code.
แตแ codeแก แ แฐแซแญ แจแตแญ แฅแแฝแแแ...
#Game
#GuessGame
@python_pioneers
แตแ codeแก แ แฐแซแญ แจแตแญ แฅแแฝแแแ...
#Game
#GuessGame
@python_pioneers
๐1
Number guessing game แ Python แญแแ แญแแตแแแฃ แฅแซแแณแแฑแ แจcodeแกแ section แฅแตแฒ แฅแแญแฃ
1. Importing the
- `random
Gameแกแ แจแแซแแฑแ แฐแ แguessing range minimum แฅแ maximum value แฅแแฒแแญแฅ แฅแแ แญแแแแแข แจแ แจแฐแแ แแแแ string data type int() function แ แแ แแ แแฐ integerแแต แฅแแแญแจแแแแข
3. Generating a Random Number:
แ แแ section แฐแแ random number generate แฅแแฒแซแจแแแ import แซแจแแแแ module แฐแ แ แแแ:
Using
4. Initializing the Guess Counter:
แฅแแ แฐแแ userแก แแ แซแ แ แแ แฅแแฐแแแฐ แจแแแแฃแ แญแ แตแ variable declare แ แญแแแแฃ initial value แฐแแ zero แฐแฅแฐแแแแข
#GuessGame
@python_pioneers
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_pioneers
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_pioneers
๐3โก1๐1
This media is not supported in your browser
VIEW IN TELEGRAM
๐๐๐๐๐๐๐๐๐๐
๐5๐1