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 በ
2. Multi-Line Comments፡ በPython ፣ ለMulti-line comments specific syntax የለም። ነገር ግን አብዛኛውን ጊዜ multi-line comments ለመፍጠር triple qoutes(ሶስት ትምህርተ ጥቅስ)(''' ወይም """) መጠቀም እንችላለን።
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 እንመልከት፡
እናም in general comments in any programming languages የሚያገለግሉት የፃፍነው code በምን ዓይነት መንገድ እንደሚሰራ ለመግለፅ ነው፣ የፃፍነውን code ደግሞ ለላ ሰው እንዲያየው share የምናረግ ከሆነ የሚያነበው ሰው የበለጠ ስለ programኡ አሰራር እንዲረዳ ያደርጋል።
@python_pioneers
በ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
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
66%
B. x = 5
25%
C. int x = 5
2%
D. declare x as 5
2. What is the purpose of comments in Python code?
Anonymous Quiz
6%
A. To make the code run faster
85%
B. To explain the purpose of the code
6%
C. To hide code from other programmers
3%
D. To declare variables
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
4. What is the difference between declaring a variable and assigning a value to it in Python?
Anonymous Quiz
19%
A. There is no difference
48%
B. Declaring initializes with a value, assigning a value changes the value of an existing variable
29%
C. Declaring a variable creates a variable, while assigning a value creates a new variable
4%
D. Assigning a value is only done with strings
5. What is the significance of using an underscore (_) in variable names in Python?
Anonymous Quiz
22%
A. It indicates a reserved word
65%
B. It separates words in a variable name
6%
C. It is not allowed in variable names
6%
D. It is used for mathematical operations
👌1
🔈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
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 ❓❓❓❓❓
Test your knowledge about arithmetic operations in python with these easy questions ❓❓❓❓❓
👍1
9. What is the result of (17 - 6) / 2 in Python?
Anonymous Quiz
77%
A) 5.5
11%
B) 6
7%
C) 6.5
5%
D) 7