Python Pioneers: A Beginner's Guide ๐Ÿ‡ช๐Ÿ‡น
8.82K subscribers
346 photos
40 videos
24 files
64 links
Welcome to Python Pioneers: Empowering Ethiopian students to embark on their coding journey.

๐Ÿ“ข Channel: @python_pioneers
๐Ÿ‘ฅ Group: @python_pioneers_chat
Download Telegram
Forwarded from Code Tactics (๐“„‚๐•พ๐–ˆ๐–”๐–—๐–•๐–Ž๐•ฏ๐–Š๐–›)
Please open Telegram to view this post
VIEW IN TELEGRAM
แˆฐแˆ‹แˆ แŠฅแŠ•แ‹ฐแˆแŠ• แ‰†แ‹ซแ‰ฝแˆ แ‹จแ‰ปแАแˆ‹แ‰ฝแŠ•แข แ‹จ @python_pioneers Subscribers!

แˆณแŠ•แŒˆแŠ“แŠ แ‰ฅแ‹™ แ‰†แ‹ญแ‰ฐแŠ“แˆแฃ แŒแŠ• แ‰ แ‹šแˆ… แŠญแˆจแˆแ‰ต แ‰ตแˆแˆ…แˆญแ‰ณแ‰ฝแŠ•แŠ• แŠฅแŠ•แ‰€แŒฅแˆ‹แˆˆแŠ•แฃ แˆ›แŠ•แŠ›แ‹แˆ แŠ แ‹ญแАแ‰ต แŒฅแ‹ซแ‰„ แ‹ˆแ‹ญแˆ แ‹ญแˆ„แŠ• แ‰ฅแ‰ณแˆจแŒ‰แฃ แ‰ฅแ‰ตแŒจแˆแˆฉ แ‰ฅแˆ‹แ‰ฝแˆ แ‹จแˆแ‰ณแˆตแ‰กแ‰ตแŠ• suggestion แŠจแˆ˜แˆตแŒ แ‰ต แ‹ˆแ‹ฐแ‹ƒแˆ‹ แŠ แ‰ตแ‰ แˆ‰แข

แ‰ แ‹šแˆ… แŠญแˆจแˆแ‰ต แŠฅแ‹šแˆ… แ‰ปแАแˆ แˆ‹แ‹ญ แ‹จแˆšแƒแ‰ แŠฎแŠ•แ‰ฐแŠ•แ‰ถแ‰ฝ:

โ–ซ๏ธContd lessons on Python
โ–ซ๏ธAward-winning questions and quizzes
โ–ซ๏ธTech related news
โ–ซ๏ธLive sessions
โ–ซ๏ธDaily inspiring quotes
โ–ซ๏ธTech related stuffs
โ–ซ๏ธ...

แ‰ แ‹šแˆ… แŠญแˆจแˆแ‰ต แ•แˆฎแŒแˆซแˆแŠ•แŒ แ‹จแˆ˜แˆ›แˆญ แˆ€แˆณแ‰ฅ แŠซแˆ‹แ‰ฝแˆ แ‹ญแˆ… แ‰ปแАแˆ แŠ แˆชแ แАแ‹แฃ แŠจแŠฅแŠ› แŒ‹แˆญ แ‰ แˆ˜แˆ›แˆญ แŠญแˆจแˆแ‰ณแ‰ฝแˆแŠ• แแˆฌแ‹ซแˆ› แŠฅแŠ•แ‹ฐแˆแ‰ณแ‹ฐแˆญแŒ‰แˆ แŠฅแˆญแŒแŒ แŠžแ‰ฝ แАแŠ•แข


แˆ˜แˆแŠซแˆ แŒŠแ‹œ แ‹ญแˆแŠ•แˆ‹แ‰ฝแˆ!


@python_pioneers
@python_pioneers
๐Ÿ‘4โค1
Control Flow Modifiers in Python

แ‰ python Control flow modifiers แ‹จแˆแŠ•แˆ‹แ‰ธแ‹ แ‰ loop แ‹ˆแ‹ญแˆ แ‰ conditional statements แ‹แˆตแŒฅ แŠจแŒˆแ‰ก normal flow of executionแŠ• แ‹จแˆšแ‰€แ‹ญแˆฉ statementแŠฆแ‰ฝ แŠ“แ‰ธแ‹แข
แŠฅแАแ‹šแˆ…แˆ modifiers แŠฅแА break, continue, แŠฅแŠ“ pass แŠ“แ‰ธแ‹

1. break Statement
แ‹ญแˆ…แŠ• แ‹จ break statement แ‹จแˆแŠ•แŒ แ‰€แˆ˜แ‹ แŠ แŠ•แ‹ตแŠ• loop prematurely แ‹ˆแ‹ญแˆ แˆ˜แŒจแˆจแˆป แˆ‹แ‹ญ แˆณแ‹ญแ‹ฐแˆญแˆต แˆˆแˆ›แ‰†แˆ แˆตแŠ•แˆแˆแŒ แАแ‹แข แŠฅแŠ“แˆ loopแŠก terminate แ‹ซแˆจแŒแŠ“ แŠจloopแŠก แ‰€แŒฅแˆŽ แˆ˜แŒ€แˆ˜แˆชแ‹ซ แ‹ซแˆˆแ‹ line of code executed แ‹ญแˆ†แŠ“แˆแข


- แˆˆแˆแˆณแˆŒ:

  for i in range(10):
if i == 4:
break
print(i) # Output: 0, 1, 2, 3


2. continue Statement

แ‹ญแˆ…แŠ›แ‹ modifier แ‹ฐแŒแˆž แ‹จloopแŠก current iteration แ‹แˆตแŒฅ แ‹ซแˆˆแ‹แŠ• code แ‹˜แˆˆแŠ• แ‹ˆแ‹ฐ แ‰€แŒฃแ‹ญ iteration แˆˆแˆ›แˆˆแ แˆตแŠ•แˆแˆแŒ แŠฅแŠ•แŒ แ‰€แˆ˜แ‹‹แˆˆแŠ•แข
loopแŠกแŠ• terminate แŠ แ‹ซแˆจแŒˆแ‹แˆ แฃ it just skips the remaining code for the current iteration.


- แˆˆแˆแˆณแˆŒ:

  for i in range(10):
if i % 2 == 0:
continue
print(i) # Output: 1, 3, 5, 7, 9

..to be contd

#break
#continue

@python_pioneers
@python_pioneers
โค3
...contd

3. pass Statement

It is a no-operation statement in Python
- pass statementแŠ• แ‹จแˆแŠ•แŒ แ‰€แˆ˜แ‹ แŠฅแŠ•แ‹ฐ place holder แАแ‹แข แˆ›แˆˆแ‰ตแˆ แ‹จแˆ†แА code แŠฅแ‹จแƒแ‹แ‰ฝแˆ แŠจแˆ†แА แŒแ‹œ แ‰ แŠƒแˆ‹ แ‹จแˆแ‰ตแŒจแˆแˆฉแ‰ต line of code แŠซแˆˆ 'pass' แŠ• แŠฅแŠ•แ‹ฐ place holder แ‰ตแŒ แ‰€แˆ™แ‰ณแˆ‹แ‰ฝแˆแข

- แˆˆแˆแˆณแˆŒ:

  if condition:
pass # To be implemented later


4. else Clause with Loops

else clause แŠจloop แŒ‹แˆญ แˆ˜แŒ แ‰€แˆ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แฃ as long as a break statement is not used.

- แˆˆแˆแˆณแˆŒ:

  for i in range(5):
print(i)
else:
print("Loop completed") # This will be printed because the loop was not terminated by a break


- แˆแˆณแˆŒ : elseแŠ• after break แˆตแŠ•แŒ แ‰€แˆ:

  for i in range(5):
if i == 3:
break
print(i)
else:
print("Loop completed") # This will not be printed because the loop was terminated by a break


แŠฅแАแ‹šแˆ…แŠ• control flow modifiers แˆ˜แˆจแ‹ณแ‰ต แ‹จloops แŠฅแŠ“ conditionals flow manage แ‰ แˆ›แˆจแŒ efficient แŠฅแŠ“ readable code แˆ˜แƒแ แŠฅแŠ•แ‹ตแ‰ตแ‰ฝแˆ‰ แ‹ญแˆจแ‹ณแ‰ฝแŠ‹แˆแข

#pass
#break

@python_pioneers
@python_pioneers
๐Ÿ”ฅ1
แŠฅแˆตแŠช แŠฅแАแ‹šแˆ…แŠ• แŠจflow control modifiers แ‹จแ‹ˆแŒก แŒฅแ‹ซแ‰„แ‹Žแ‰ฝแŠ• แˆžแŠญแˆฏแ‰ธแ‹โญ๏ธ
2. What will be the output of the following code?

   for i in range(5):
if i == 3:
break
print(i)


- A) 0 1 2

- B) 0 1 2 3

- C) 0 1 2 3 4

- D) None of the above
๐Ÿ‘1
3. Which keyword is used to skip the rest of the code inside the loop for the current iteration only?
Anonymous Quiz
4%
A) skip
43%
B) break
43%
C) continue
9%
D) pass
4. What will be the output of the following code?

   x = 5
while x > 0:
x -= 1
if x == 2:
continue
print(x)


- A) 4 3 2 1 0

- B) 4 3 1 0

- C) 5 4 3 2 1

- D) 5 4 3 1 0
You're gonna write a python program that processes numbers from 1 to 20 and follow these rules.

1. Skip (continue) numbers that are divisible by 3.

2. Stop (break) the loop if the number is greater than 15.

Print all the other numbers

You can use for loop to iterate through the numbers 1 to 20

แŠฅแˆตแ‰ฒ แˆžแŠญแˆฉแ‰ต

#Exercise

@python_pioneers
๐Ÿ‘2
Google or Googol

The name Google was created accidentally, it was originally supposed to be named โ€˜Googolโ€™. (Googol is the digit 1 followed by 100 zeroes).

The founders checked to see if that domain name was taken, but accidentally searched for โ€˜google.comโ€™ instead of โ€˜googol.comโ€™.

They liked that name even better and registered the domain name on September 15, 1997

#Facts
#Google

@python_pioneers
๐Ÿ‘2
THE ONLY WAY TO AVOID MISTAKES IS TO GAIN EXPERIENCE; THE ONLY WAY TO GAIN EXPERIENCE IS BY MAKING MISTAKES.


This quote reminds us that mistakes are an integral part of the process of learning and growth.

แˆ˜แˆแŠซแˆ แˆแˆฝแ‰ต แ‹ญแˆแŠ•แˆ‹แ‰ฝแˆ!

#Quotes

-> @Gr8r_Abb

๐Ÿ’ฌ Buzz Quotes

@python_pioneers
โค3๐Ÿ”ฅ1
แ‰ แ‰€แŒฃแ‹ญ =>
LISTS IN PYTHON

แ‰ แ‰€แŒฃแ‹ญ แ‰ Python List แˆแŠ• แŠฅแŠ•แ‹ฐแˆ†แАแฃ แˆˆแˆแŠ• แŠฅแŠ•แ‹ฐแˆšแ‹ซแˆตแˆแˆแŒˆแŠ•แŠ“ แŠฅแŠ•แ‹ดแ‰ต แˆ˜แŒ แ‰€แˆ แŠฅแŠ•แ‹ณแˆˆแ‰ฅแŠ• แŠฅแŠ•แˆ›แˆซแˆˆแŠ•แข

Stay tuned!

@python_pioneers
@python_pioneers
๐Ÿ‘3
Forwarded from The Coffee Talk Table
แ‰ แŒŽแ‹ แ‹žแŠ• แ‰ แŠ“แ‹ณ แŠ แ‹ฐแŒ‹ แˆˆแ‰ฐแˆแŠ“แ‰€แˆ‰แŠ“ แˆˆแ‰ฐแŒŽแ‹ฑ แ‹จแˆ…แ‰ฅแˆจแ‰ฐแˆฐแ‰ฅ แŠญแแˆŽแ‰ฝ แ‹ตแŒ‹แ แŠฅแŠ“แ‹ตแˆญแŒแฃ แ‰ แˆ…แ‹ญแ‹ˆแ‰ต แˆˆแ‰ฐแˆจแ‰แ‰ต แŠฅแŠ•แ‹ตแˆจแˆตแˆ‹แ‰ธแ‹

แ‰ แ‹žแŠ‘ แ‹จแŠ แ‹ฐแŒ‹ แŒŠแ‹œ แ‹แŒแŒแАแ‰ต แˆ›แ‰‹แ‰‹แˆšแ‹ซ :

แ‹จแŠขแ‰ตแ‹ฎแŒตแ‹ซ แŠ•แŒแ‹ต แ‰ฃแŠ•แŠญ แˆ‚แˆณแ‰ฅ แ‰แŒฅแˆญ
1000511561276

แˆ‹แ‹ญ แ‹ตแŒ‹แ แŠฅแŠ•แ‹ฒแ‹ซแ‹ฐแˆญแŒ‰ แ‰ฐแŒ แ‹ญแ‰€แ‹‹แˆแข


แŠฅแˆตแŠซแˆแŠ• 230 แˆฐแ‹Žแ‰ฝ แˆ…แ‹ญแ‹ˆแ‰ต แ‰ แ‹šแˆ… แŠ แ‹ฐแŒ‹ แŠ แˆแแˆ : :
๐Ÿ˜ข2
Introduction to Lists


แŠ แŠ•แ‹ต แ•แˆฎแŒแˆซแˆ แ‰ แˆแŠ•แŒฝแแ‰ แ‰ต แŒŠแ‹œ แ‰ฅแ‹™ แˆ˜แˆจแŒƒแ‹Žแ‰ฝแŠ• store แŠฅแŠ“แˆจแŒ‹แˆˆแŠ• แŠจแ‹šแ‹ซแˆ แŠฅแАแ‹šแ‹ซ แˆ˜แˆจแŒƒแ‹Žแ‰ฝ manage แˆˆแˆ›แ‹ตแˆจแŒ แ‹จแˆšแ‹ซแˆตแ‰ธแŒแˆฉ แ‹ญแˆ†แŠ“แˆ‰แข แŠฅแАแˆฑแŠ• แ‹ฐแŒแˆž retrieve แˆ›แˆจแŒ แฃ แˆ›แ‹แŒฃแ‰ตแฃ แˆ›แŒแŠ˜แ‰ต แŠฅแŠ“ แˆ˜แŒ แ‰€แˆ แ‰ แŒฃแˆ แŠจแ‰ฃแ‹ต แ‹ญแˆ†แŠ“แˆแข

แˆตแˆˆแ‹šแˆ… แŠฅแАแ‹šแ‹ซแŠ• แˆ˜แˆจแŒƒแ‹Žแ‰ฝ แ‰ แ‰กแ‹ตแŠ•/แ‰ แˆ˜แˆ˜แ‹ฐแ‰ฅ/ แŠจแ‹šแ‹ซแˆ แ‰ แŠ แŠ•แ‹ต variable แ‹แˆตแŒฅ store แˆ›แˆจแŒ แŠ แˆˆแ‰ฅแŠ•แข แ‰ Programming แ‹แˆตแŒฅ, แ‹ญแˆ… แˆ‚แ‹ฐแ‰ต แŠฅแŠ•แ‹ฐ Data structure แ‹ญแ‰ฃแˆ‹แˆแข

Data Structure is a particular way of organizing data in a computer so that it can be used effectively.


แ‹จ List แ‰ฃแˆ…แˆชแ‹ซแ‰ต

1. Lists แ‰ฐแˆ˜แˆณแˆณแ‹ญ แ‹ˆแ‹ญแˆ แ‹จแ‰ฐแˆˆแ‹ซแ‹จ (heterogeneous) data types store แˆ›แ‹ตแˆจแŒ แ‹ญแ‰ฝแˆ‹แˆ‰

2. Lists dynamic แŠ“แ‰ธแ‹ แˆ›แˆˆแ‰ตแˆ we don't need to mention the size of the list while declaring.

3. Order is preserved, แ‹ˆแ‹ญแˆ insert แ‹ซแˆจแŒแАแ‹แŠ• data as long as there are no modifications to the list แ‰ แ‰ฐแˆ˜แˆณแˆณแ‹ญ order แАแ‹ outputแŠกแŠ•แˆ แ‹จแˆแŠ“แŒˆแŠ˜แ‹แข

4. Lists duplicate แ‹จแˆ†แА element แˆ˜แ‹ซแ‹ แ‹ญแ‰ฝแˆ‹แˆ‰

5. In lists แ‹‹แŠ“แ‹แŠ• แˆšแŠ“ แ‹จแˆšแŒซแ‹ˆแ‰ฐแ‹ index แАแ‹แฃ Index แ‰ แˆ˜แŒ แ‰€แˆ แАแ‹ แ‹จlistแŠกแŠ• elements access แ‹จแˆแŠ“แˆจแŒˆแ‹ (แˆตแˆˆ index แ‰ แ‰€แŒฃแ‹ญ แŠฅแŠ“แ‹ซแˆˆแŠ•)

6. List objects mutable แŠ“แ‰ธแ‹ แˆ›แˆˆแ‰ตแˆ listแŠก แŠจแ‰ฐแˆแŒ แˆจ แ‰ แŠ‹แˆ‹ แ‹จlistแŠกแŠ• content modify แˆ›แˆจแŒ แ‹ˆแ‹ญแˆ แˆ˜แ‰€แ‹จแˆญ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แข

...to be contd

#Lists

@python_pioneers
@python_pioneers
๐Ÿ‘2
...contd

How to create a List?


List create แˆˆแˆ›แˆจแŒ แ‰ฅแ‹™ แŠ แ‹ญแАแ‰ต แˆ˜แŠ•แŒˆแ‹ถแ‰ฝ แŠ แˆ‰แฃ แŠฅแˆตแŠช แ‰ แˆแˆณแˆŒ แŠฅแŠ•แˆ˜แˆแŠจแ‰ณแ‰ธแ‹:

1. Using square brackets

แ‰ python list square brackets แ‰ แˆ˜แŒ แ‰€แˆ แˆ˜แแŒ แˆญ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แฃ แ‹จlistแŠกแŠ• elements แ‹ฐแŒแˆž แ‰ comma แŠฅแŠ•แˆˆแ‹ซแ‹ซแ‰ธแ‹‹แˆˆแŠ•แข
Syntax
:
list_name = [elements]

แˆˆแˆแˆณแˆŒ:
my_list = [1, 2, 3, 4, 5]


2. Using list() function

แˆแˆˆแ‰ฐแŠ›แ‹ list แˆ˜แแŒ แˆชแ‹ซ แˆ˜แŠ•แŒˆแ‹ต แ‹ฐแŒแˆž list() แ‹จแˆšแ‰ฃแˆ built-in function แ‰ แˆ˜แŒ แ‰€แˆ แАแ‹แข แ‹ญแˆ„แŠ• แ‹ฐแŒแˆž แ‹จแˆแŠ•แŒ แ‰€แˆ˜แ‹ แŠจแ‰ฐแˆˆแ‹ซแ‹ฉ data types like : strings, set, tuple ...etc list แˆ˜แแŒ แˆญ แˆตแŠ•แˆแˆแŒ แАแ‹แข

Set, tuple, Dictionary -> แ‰ แ‰€แŒฃแ‹ญ แŠฅแŠ•แˆ›แˆซแ‰ธแ‹‹แˆˆแŠ•

แˆˆแˆแˆณแˆŒ:

name = "ABEBE"

my_list = list(name)

print(my_list) # Output : ['A', 'B', 'E', 'B', 'E']


3. Using list() and range() function

แ‹จrange() function sequence of numbers create แ‹ซแˆจแŒ‹แˆแฃ starting from 0 by default, and increments by 1 (by default), แŠฅแŠ“ specified แŠจแˆ†แАแ‹ แ‰แŒฅแˆญ แ‰ แŠแ‰ต แ‹ญแ‰†แˆ›แˆแข

...to be contd

#Lists

@python_pioneers
@python_pioneers
๐Ÿ‘5๐Ÿ™1