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
...contd

3. Logical Operations:

The operands here are boolean values (True and False).

- AND (and): Returns True if both operands are true.

- OR (or): Returns True if any of the operands are true.

- NOT (not): Returns True if the operand is false.

Code Example:

p = True
q = False
and_result = p and q # result = False
or_result = p or q # result = True
not_result = not p # result = False

4. Assignment Operations:
แŠฅแАแ‹šแˆ… แ‹ฐแŒแˆž แŠ แŠ•แ‹ตแŠ• value แˆˆvariable assign แˆˆแˆ›แ‹ตแˆจแŒ แАแ‹ แ‹จแˆแŠ•แŒ แ‰€แˆ˜แ‹แข

+= : แ‰ แ‰€แŠ แ‰ แŠฉแˆ แ‹ซแˆˆแ‹แŠ• operand แ‰ แŒแˆซ แ‰ แŠฉแˆ แ‰ฃแˆˆแ‹ operand แˆ‹แ‹ญ แ‹ญแ‹ฐแˆแˆญแŠ“ แ‹แŒคแ‰ฑแŠ• แ‰ แŒแˆซ แ‰ แŠฉแˆ แˆ‹แˆˆแ‹ operand assign แ‹ซแˆจแŒˆแ‹‹แˆแข

-= : แ‰ แ‰€แŠ แ‰ แŠฉแˆ แ‹ซแˆˆแ‹แŠ• operand แŠจแŒแˆซแ‹ แ‰ แˆ˜แ‰€แАแˆต แ‹แŒคแ‰ฑแŠ• แ‰ แŒแˆซ แ‰ แŠฉแˆ แˆ‹แˆˆแ‹ operand assign แ‹ซแˆจแŒ‹แˆแข


*= : แ‰ แŒแˆซ แ‰ แŠฉแˆ แ‹ซแˆˆแ‹แŠ• operand แ‰ แ‰€แŠ แ‰ แŠฉแˆ แ‰ฃแˆˆแ‹ แ‹ซแ‰ฃแ‹›แŠ“ แ‹แŒคแ‰ฑแŠ• แ‰ แŒแˆซ แ‰ แŠฉแˆ แˆ‹แˆˆแ‹ operand assign แ‹ซแˆจแŒ‹แˆแข

/= : แ‰ แŒแˆซ แ‰ แŠฉแˆ แ‹ซแˆˆแ‹แŠ• operand แ‰ แ‰€แŠ แ‰ แŠฉแˆ แ‰ฃแˆˆแ‹ operand แ‹ซแŠซแแˆแŠ“ แ‹แŒคแ‰ฑแŠ• แ‰ แŒแˆซ แ‰ แŠฉแˆ แˆ‹แˆˆแ‹ operand assign แ‹ซแˆจแŒˆแ‹‹แˆแข

Code Example:
x = 5
x += 3 # Equivalent to x = x + 3
x -= 2 # Equivalent to x = x - 2
x *= 4 # Equivalent to x = x * 4
x /= 2 # Equivalent to x = x / 2

These are just some of the basic operations in python, we believe you have grasped some knowledge about them.


@python_pioneers
@python_pioneers
๐Ÿ‘3โค1
GROW THROUGH WHAT YOU GO THROUGH.

แ‹จแˆšแ‹ซแŒ‹แŒฅแˆ˜แŠ• แˆ›แŠ•แŠ›แ‹แˆ แˆแ‰ฐแŠ“ แŠฅแŠ“ แˆ˜แˆฐแŠ“แŠญแˆ แˆˆแˆ˜แˆ›แˆญแฃ แˆˆแˆ›แ‹ฐแŒ แŠฅแŠ“ แˆˆแˆ˜แŒ แŠ•แŠจแˆญ แŠฅแ‹ตแˆ แ‹ญแˆฐแŒ แŠ“แˆแข แ‰ แˆšแ‹ซแŒ‹แŒฅแˆ™แŠ• แ‰ฝแŒแˆฎแ‰ฝ แŠจแˆ˜แˆ›แˆจแˆญ แ‹ˆแ‹ญแˆ แŠจแˆ˜แŠ“แ‹ฐแ‹ต แ‹ญแˆแ‰… แˆˆself development แŠฅแŠ“ แŠฅแˆซแˆณแ‰ฝแŠ•แŠ• แˆˆแˆ›แˆปแˆปแˆ แŠฅแŠ•แ‹ฐ แŠฅแ‹ตแˆ แŠ แ‹ตแˆญแŒˆแŠ• แˆ˜แ‰€แ‰ แˆ แŠ แˆˆแ‰ฅแŠ•แข

แˆ˜แˆแŠซแˆ แˆแˆฝแ‰ต!

@python_pioneers
๐Ÿ‘5๐Ÿฅฐ2
COMMENTS IN PYTHON

PythonแŠ• แ‰ แŠ แˆ›แˆญแŠ› แŠฅแŠ•แˆ›แˆญ!

Stay Tuned!
@python_pioneers
๐Ÿ‘2
Python Pioneers: A Beginner's Guide ๐Ÿ‡ช๐Ÿ‡น
COMMENTS IN PYTHON PythonแŠ• แ‰ แŠ แˆ›แˆญแŠ› แŠฅแŠ•แˆ›แˆญ! Stay Tuned! @python_pioneers
COMMENTS IN PYTHON

แ‰ Pythonแก Comments แ‰ Python interpreter ignore แ‹จแˆšแ‹ฐแˆจแŒ‰ แˆ›แ‰ฅแˆซแˆชแ‹ซแ‹Žแ‰ฝ แŠ“แ‰ธแ‹แข แ‹จแƒแแАแ‹แŠ• code purpose แˆˆแˆ˜แŒแˆˆแ…แฃ แŠฅแŠ•แ‹ดแ‰ต แŠฅแŠ•แ‹ฐแˆšแˆฐแˆซแฃ แŠฅแŠ“ แˆŒแˆŽแ‰ฝ แˆ˜แˆจแŒƒแ‹Žแ‰ฝแŠ• แˆˆแˆ˜แƒแ แŠฅแŠ•แŒ แ‰€แˆ›แ‰ธแ‹‹แˆˆแŠ•แข Comments are crucial for code readability and maintenance

TYPES OF COMMENTS IN PYTHONแก-

1. Single-Line Commentsแก แŠฅแАแ‹šแˆ… comments แ‰ # แˆแˆแŠญแ‰ต แ‹ญแŒ€แˆแˆซแˆ‰ แŠฅแŠ“ แŠฅแˆตแŠจ line แˆ˜แŒจแˆจแˆป แ‹ตแˆจแˆต แ‹ญแ‰€แŒฅแˆ‹แˆ‰ แข แŠฅแАแ‹šแˆ…แŠ• แ‹ฐแŒแˆž แˆˆแŠ แŒซแŒญแˆญ แˆ›แ‰ฅแˆซแˆชแ‹ซแ‹Žแ‰ฝ แŠฅแŠ•แŒ แ‰€แˆ›แ‰ธแ‹‹แˆˆแŠ•แข

    # This is a single-line comment
x = 5 # This is also a single-line comment

2. Multi-Line Commentsแก แ‰ Python แฃ แˆˆMulti-line comments specific syntax แ‹จแˆˆแˆแข แАแŒˆแˆญ แŒแŠ• แŠ แ‰ฅแ‹›แŠ›แ‹แŠ• แŒŠแ‹œ multi-line comments แˆˆแˆ˜แแŒ แˆญ triple qoutes(แˆถแˆตแ‰ต แ‰ตแˆแˆ…แˆญแ‰ฐ แŒฅแ‰…แˆต)(''' แ‹ˆแ‹ญแˆ """) แˆ˜แŒ แ‰€แˆ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แข

    '''
This is a multi-line comment.
It spans across multiple lines.
'''

3. Docstringsแก Docstringsแก functions, modules, แŠฅแŠ“ classes document แˆˆแˆ›แ‹ตแˆจแŒ แ‹ญแŒ แ‰…แˆ›แˆ‰แข They are enclosed in triple quotes and provide more detailed explanations of the purpose, parameters, and return values of functions.

แˆˆแˆแˆณแˆŒ แ‹ญแˆ„แŠ•แŠ• code แŠฅแŠ•แˆ˜แˆแŠจแ‰ตแก

    def add_numbers(a, b):
"""
This function adds two numbers together.

Parameters:
a (int): The first number.
b (int): The second number.

Returns:
int: The sum of a and b.
"""
return a + b

แŠฅแŠ“แˆ in general comments in any programming languages แ‹จแˆšแ‹ซแŒˆแˆˆแŒแˆ‰แ‰ต แ‹จแƒแแАแ‹ code แ‰ แˆแŠ• แ‹“แ‹ญแАแ‰ต แˆ˜แŠ•แŒˆแ‹ต แŠฅแŠ•แ‹ฐแˆšแˆฐแˆซ แˆˆแˆ˜แŒแˆˆแ… แАแ‹แฃ แ‹จแƒแแАแ‹แŠ• code แ‹ฐแŒแˆž แˆˆแˆ‹ แˆฐแ‹ แŠฅแŠ•แ‹ฒแ‹ซแ‹จแ‹ share แ‹จแˆแŠ“แˆจแŒ แŠจแˆ†แА แ‹จแˆšแ‹ซแАแ‰ แ‹ แˆฐแ‹ แ‹จแ‰ แˆˆแŒ  แˆตแˆˆ programแŠก แŠ แˆฐแˆซแˆญ แŠฅแŠ•แ‹ฒแˆจแ‹ณ แ‹ซแ‹ฐแˆญแŒ‹แˆแข

@python_pioneers
๐Ÿ‘3
There is no straight path to success. The problems we face have the ability to shape us. Grow through them.

HARD WORK
|
|
PROBLEM
|
SETBACK
|
FAILURE
|
CHALLENGE
|
OBSTACLE
|
|
SUCCESS

Have a nice day!

@python_pioneers
๐Ÿ‘1
Let's Revise what we have been learning with these questions.
๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
1. What is the correct way to declare a variable in Python?
Anonymous Quiz
7%
A. var x = 5
67%
B. x = 5
25%
C. int x = 5
2%
D. declare x as 5
3. What type of operations can you perform on variables in Python?
Anonymous Quiz
12%
A. Mathematical operations
6%
B. String operations
0%
C. Logical operations
82%
D. All of the above
๐Ÿ”ˆNew Subscribers

Welcome!

It is good for you if you scroll up and see the previous lessons we have been learning.

Also don't forget to invite your friends ,who are interested in programming, to our channel.

@python_pioneers
Python Pioneers: A Beginner's Guide ๐Ÿ‡ช๐Ÿ‡น pinned ยซ๐Ÿ”ˆNew Subscribers Welcome! It is good for you if you scroll up and see the previous lessons we have been learning. Also don't forget to invite your friends ,who are interested in programming, to our channel. @python_pioneersยป
1โƒฃ0โƒฃ1โƒฃ0โƒฃ1โƒฃ1โƒฃ0โƒฃ1โƒฃ0โƒฃ1โƒฃ1โƒฃ0โƒฃ1โƒฃ1โƒฃ1โƒฃ0โƒฃ1โƒฃ0โƒฃ
Test your knowledge about arithmetic operations in python with these easy questions โ“โ“โ“โ“โ“
1. What is the result of 10 + 5 in Python?
Anonymous Quiz
3%
A) 13
91%
B) 15
6%
C) 17
0%
D) 20
2. What is the result of 25 - 9 in Python?
Anonymous Quiz
0%
A) 12
9%
B) 15
86%
C) 16
5%
D) 20
3. What is the result of 6 * 4 in Python?
Anonymous Quiz
2%
A) 22
94%
B) 24
3%
C) 26
2%
D) 28
4. What is the result of 16 / 4 in Python?
Anonymous Quiz
3%
A) 2.5
3%
B) 3.0
94%
C) 4.0
0%
D) 5.2
5. What is the result of 18 % 7 in Python?
Anonymous Quiz
10%
A) 1
21%
B) 2
13%
C) 3
55%
D) 4
6. What is the result of 8 ** 2 in Python?
Anonymous Quiz
2%
A) 60
89%
B) 64
5%
C) 68
5%
D) 72
7. What is the result of 27 // 4 in Python?
Anonymous Quiz
66%
A) 6
20%
B) 7
9%
C) 8
5%
D) 9