Python Pioneers: A Beginner's Guide πŸ‡ͺπŸ‡Ή
8.62K 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
Some programming memes

Have fun😊

@python_pioneers
😁5
πŸš‘ Scientists from USA have developed an inexpensive electric bandage that speeds up wound healing by 30%.

To activate the bandage, you just need to moisten it, and it starts delivering a weak current that stimulates cells and suppresses bacterial growth.

It's a single-use product, but it’s expected to cost just $1. However, there’s no production timeline yet as clinical trials are still ahead.


#Technology
#Tech
#News

@hitechdailynews
@python_pioneers
πŸ‘2😨1
πŸ‘3
Next➑ : Mathematical Operations on List (using List Methods)
Mathematical Operations on List (using List Methods)

αŠ αŠ•α‹΅ list αˆ‹α‹­ mathematical operations αˆˆαˆ›αŠ«αˆ„α‹΅ α‹¨αˆαŠ•αŒ α‰€αˆ›α‰Έα‹ α‰₯α‹™ αŠ α‹­αŠα‰΅ methods αŠ₯αŠ•α‹΅αˆαˆ α‰₯α‹™ αŠ₯α‹­αŠα‰΅ functions αŠ αˆ‰α’

Let's see them one by one...

1. len()

α‹­αˆ„αŠ•αŠ• len() function α‹¨αˆαŠ•αŒ α‰€αˆ˜α‹ α‰ αŠ αŠ•α‹΅ listα‹αˆ΅αŒ₯ α‹«αˆ‰α‰΅αŠ• elements α‰₯ዛቡ(የlistαŠ‘αŠ• length) αˆˆαˆ›α‹ˆα‰… αˆ΅αŠ•αˆαˆαŒ αŠα‹α’

Syntax: 
len(list_name)

ለምሳሌ :

Items = ["rubber", "pencil", "book", "pen"]
length = len(Items)

print(length)

#Output : 4

2. count() method

α‹­αˆ„αŠ•αŠ• method α‹°αŒαˆž α‹¨αˆαŠ•αŒ α‰€αˆ˜α‹ α‰ αŠ αŠ•α‹΅ list α‹αˆ΅αŒ₯ α‹«αˆˆ α‹¨αˆ†αŠ specific element αˆαŠ• α‹«αˆ…αˆ occur αŠ₯αŠ•α‹³αˆ¨αŒˆ αˆˆαˆ›α‹ˆα‰… αˆ΅αŠ•αˆαˆαŒ αŠα‹α’

Syntax :
list_name.count(element)

ለምሳሌ :

alps = ["a", "e", "g", "a", "f", "g", "a"]

occurrence_of_a = alps.count("a")

print(occurrence_of_a)

#Output : 3


3. max()

max() function α‰ αŠ αŠ•α‹΅ list α‹αˆ΅αŒ₯ α‰΅αˆα‰αŠ• element return α‹«αˆ¨αŒ‹αˆα’

Syntax :
max(list_name)

4. min()

min() function α‹°αŒαˆž α‰ α‰°α‰ƒαˆ«αŠ’α‹ α‹¨αŠ αŠ•α‹΅αŠ• list α‰΅αŠ•αˆΉαŠ• element return α‹«αˆ¨αŒαˆαŠ“αˆα£

Syntax :
min(list_name)

max() αŠ₯αŠ“ min() function α‰ αˆαˆ³αˆŒ αŠ₯αŠ•αˆ˜αˆαŠ¨α‰΅α’

nums = [5, 90, 34, 65, 23, 7, 10]

print(max(nums)) #Output : 90

print(min(nums)) #Output : 5

...

#MathsOpOnLists
#Lists

@python_pioneers
πŸ‘1
Here are some multiple choice questions: Answer them by reacting for the correct ones as stated below πŸ‘‡

A == 😁
B == 😭
C == 😒
D == πŸ€“
1. What is the result of the following operation?

list1 = [1, 2, 3]
list2 = [4, 5, 6]
result = list1 + list2

- 😁) [1, 2, 3, 4, 5, 6]

-😭) [5, 7, 9]

-😒) [(1, 4), (2, 5), (3, 6)]

-πŸ€“) None of the above
😁8
2. What does the following Python code return?

list1 = [1, 2, 3]
result = list1 * 2

- 😁) [2, 4, 6]

-😭) [1, 2, 3, 1, 2, 3]

-😒) [1, 1, 2, 2, 3, 3]

-πŸ€“) None of the above
😭6😁1
Nice question

In case of lists containing strings, when we use max() and min() function, they return the maximum or minimum element based on lexicographical order

ለምሳሌ:

"name" has higher lexicographic order than "age", so if we use max() for a list containing only the two, the function returns "name"

But also there's something called key, in which you specify the criteria you want to compare by

Is this helpful πŸ‘†
πŸ‘2
3. What will be the output of the following code?

numbers = [5, 10, 15, 20, 25]
print(max(numbers))


😁) 5
😭) 10
😒) 25
πŸ€“) 20
😒6
4. What will be the output of the following code?

numbers = [3, 7, 2, 9, 4]
print(len(numbers))

😁) 9
😭) 4
😒) 3
πŸ€“) 5
πŸ€“3
5. What will be the output of the following code?

words = ["apple", "banana", "orange", "kiwi"]
print(max(words))


😁) "apple"
😭) "banana"
😒) "orange"
πŸ€“) "kiwi"
😭1
6. What will be the output of the following code?

words = ["cat", "sheep", "elephant", "bird"]
print(min(words, key=len))

😁) "cat"
😭) "bird"
😒) "sheep"
πŸ€“) "elephant"
😁2πŸ€“1