Python Pioneers: A Beginner's Guide ๐Ÿ‡ช๐Ÿ‡น
8.84K 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
1. What is the output of the following code?

my_list = [1, 2, 3, 4, 5]
print(my_list[1:4])

A) [1, 2, 3]
B) [2, 3, 4]
C) [2, 3, 4, 5]
D) [1, 2, 3, 4]


2. What is the result of running the following code?

my_list = [1, 2, 3, 4, 5]
new_list = my_list[::-1]
print(new_list)

A) [5, 4, 3, 2, 1]
B) [1, 2, 3, 4, 5]
C) [5, 4, 3, 2]
D) [4, 3, 2, 1]

3. What will be the output of the following code snippet?

my_list = [1, 2, 3, 4, 5]
my_list[2] = 6
print(my_list)

A) [1, 2, 6, 4, 5]
B) [1, 2, 3, 6, 5]
C) [1, 2, 6, 3, 4]
D) [1, 2, 3, 4, 6]

4. What does the following code do?

my_list = [1, 2, 3, 4, 5]
del my_list[2]

A) Removes the element at index 2 from the list
B) Removes the last element from the list
C) Adds the element at index 2 to the list
D) Replaces the element at index 2 with a new value

5. How can you check if a specific value exists in a list in Python?

A) Using the in keyword
B) Using the exists() method
C) Using the exists keyword
D) Using the contains() method

#Quiz
#PrizeWinningQuiz

@python_pioneers
@python_pioneers
๐Ÿ‘1
โŒšTime's Up

Thank you all of you for your participation.

We will announce the winner...๐Ÿ†
๐Ÿ‘1
The winner is : @Abemelekk

Congratulations ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

@python_pioneers
โค1๐Ÿ‘1
The winner has received the prize ๐Ÿ†

You all did great participating in the quiz. Most of you were correct, but some of you were a little late.

THANK YOU!

@python_pioneers
๐Ÿ‘3
"The only way to achieve the impossible is to believe it is possible."

-Unknown


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

#Quote

@python_pioneers
๐Ÿ”ฅ2๐Ÿ’ฏ1
Forwarded from Luna's pathway๐Ÿค— (Luna)
The Black Dot Story

One day, a professor entered the classroom and asked his students to prepare for a surprise test. They all waited anxiously at their desks for the exam to begin. The professor handed out the exams with the text facing down, as usual. Once he handed them all out, he asked the students to turn over the papers. To everyoneโ€™s surprise, there were no questions โ€“ just a black dot in the center of the sheet of paper. The professor, seeing the expression on everyoneโ€™s faces, told them the following: โ€œI want you to write about what you see there.โ€ The students, confused, got started on the inexplicable task. At the end of the class, the professor took all the exams, and started reading each one of them out loud, in front of all the students. All of them, with no exception, defined the black dot, trying to explain its position in the center of the sheet. After all had been read, the classroom silent, the professor started to explain: โ€œIโ€™m not going to grade you on this, I just wanted to give you something to think about. No one wrote about the white part of the paper. Everyone focused on the black do โ€“ and the same happens in our lives. We have a piece of paper to observe and enjoy, but we always focus on the dark spots. Our life is a gift, and we always have reasons to celebrate โ€“ nature renewing itself daily, friends around us, the job that provides our livelihood, etc.
However, we insist on focusing only on the dark spot โ€“ the health issues that bother us, the lack of money, the complicated relationships with others, or the disappointment with a friend. The dark spots are very small when compared to everything we have in our lives, but theyโ€™re the ones that pollute our mind. Take your eyes away from the black dots in your life. Enjoy each one of your blessings and each moment that life gives you. Be happy and live a life such that even the undertaker will be disappointed when it is your time to go.

Happy Weekend ๐Ÿ˜๐Ÿ˜

Tag
the author if you guys know ๐Ÿ™
Please open Telegram to view this post
VIEW IN TELEGRAM
โค3
แ‰ แ‹›แˆฌแ‹ แˆแŒฃแŠ• แŠ แˆˆแˆ แ‰ฃแˆ‹แˆฐแˆˆแˆฐ แ‰ตแˆแˆ…แˆญแ‰ต แŠฅแŠ“ แ‹จแŠญแˆ‚แˆŽแ‰ต แŠฅแ‹ตแŒˆแ‰ต แ‹แˆตแŒฅ แˆ˜แˆณแ‰ฐแ แŠจแˆ˜แ‰ผแ‹แˆ แŒŠแ‹œ แ‹ญแ‰ แˆแŒฅ แŠฅแŒ…แŒ แŠ แˆตแˆแˆ‹แŒŠ แˆ†แŠ—แˆแข

แ‰ แˆจแแ‰ต แˆ‹แ‹ญ แˆ‹แˆ‹แ‰ฝแˆ แ‰ฐแˆ›แˆชแ‹Žแ‰ฝแฃ แˆˆแ‹ˆแŒฃแ‰ต แ‰ฃแˆˆแˆžแ‹ซแ‹Žแ‰ฝแฃ แˆซแˆณแ‰ธแˆแŠ• แ‰ แŠฅแ‹แ‰€แ‰ต แ‰ แˆ˜แŒˆแŠ•แ‰ฃแ‰ต แ‰ แˆ€แŒˆแˆญ แ‹แˆตแŒฅแˆ แˆ†แА แ‰ แ‹แŒญ แ‰ แŒŽ แ‰ฐแ…แ‹•แŠ– แˆˆแˆ˜แแŒ แˆญ แˆˆแˆแ‰ตแŒ“แŒ‰ แˆแˆ‰ แ‹จแŠ แˆแˆตแ‰ต แˆšแˆŠแ‹ฎแŠ• แŠฎแ‹ฐแˆญแˆต แ•แˆฎแŒ€แŠญแ‰ต แ‰€แ‹ณแˆš แˆŠแ‹ซแ‹ฐแˆญแŒ‹แ‰ฝแˆ แ‰ฐแˆฐแŠ“แ‹ตแ‰ถแˆ‹แ‰ฝแŠ‹แˆแข แ‹จแ‰ตแˆแˆ…แˆญแ‰ต แŠฅแŠ“ แ‹จแŠฅแ‹แ‰€แ‰ต แˆ˜แАแˆปแ‰ฝแˆ แŠฅแŠ“ แ‹ซแˆ‹แ‰ฝแˆแ‰ แ‰ต แ‹ฐแˆจแŒƒ แˆแŠ•แˆ แ‹ญแˆแŠ• แ‹ซแˆ‹แ‰ฝแˆแŠ• แŠญแˆ‚แˆŽแ‰ต แˆˆแˆ›แˆณแ‹ฐแŒแˆ แˆ†แА แŠ แ‹ฒแˆต แАแŒˆแˆญ แˆˆแˆ›แ‹ˆแ‰… แˆˆแˆแ‰ตแˆน แˆแˆ‰ แˆฐแŠ แ‹จแŠฅแ‹ตแˆ แ‰ แˆญ แ‰ฐแŠจแแ‰ถแˆ‹แ‰ฝแŠ‹แˆแข

แ‰ แˆ˜แˆ‹แ‹ แŠขแ‰ตแ‹ฎแŒตแ‹ซ แ‹ซแˆ‹แ‰ฝแˆ แ‹จแŠญแˆ‚แˆŽแ‰ต แŠ แ‰ แˆแƒแŒŠแ‹Žแ‰ฝแฃ แŠ แˆฃแ‹ณแŒŠแ‹Žแ‰ฝแฃ แ‹ฉแŠ’แ‰จแˆญแˆฒแ‰ฒแ‹Žแ‰ฝ แ‹ญแŠฝแŠ•แŠ• แ•แˆฎแŒ€แŠญแ‰ต แŠฅแŠ“ แŠฅแŠ•แ‰…แˆตแ‰ƒแˆดแ‹Žแ‰นแŠ• แŠฅแŠ•แ‹ฒแ‹ฐแŒแ‰ แŒฅแˆช แŠ แ‰€แˆญแ‰ฃแˆˆแˆแข 

แ‹แ‹ต แ‰ฃแˆˆแ‰ฐแˆฐแŒฅแ‹–แ‹Žแ‰ฝ แฃ แ‹จแŠขแ‰ตแ‹ฎแŒตแ‹ซแ‰ฝแŠ• แŒฅแŠ•แŠซแˆฌ แ‰ แŠฅแŠ“แŠ•แ‰ฐ แŠฅแ‹ตแŒˆแ‰ต แˆ‹แ‹ญ แ‹จแ‰ฐแˆ˜แˆ แˆจแ‰ฐ แАแ‹แข

แˆˆแˆ˜แˆ˜แ‹แŒˆแ‰ฅ: http://www.ethiocoders.et

In today's fast-paced world, continuous learning and skills development are more important than ever.

To all students on break, young professionals, and those eager for personal growth and making a positive impact locally and beyond: the 5 Million Coders initiative has been launched to help you stay ahead, regardless of your career stage or goals. Whether you're looking to enhance your current skills, learn something new, or prepare for future opportunities, this initiative is designed for you.

I also strongly encourage everyone involved in skill-building in Ethiopiaโ€”incubators, accelerators, universities, and othersโ€”to fully embrace this initiative. Our nation's strength lies in your growth!"

Register through: http://www.ethiocoders.et
๐Ÿ‘1
This media is not supported in your browser
VIEW IN TELEGRAM
Realme has announced a 300W fast charger. Thanks to the new technology, the smartphone charges from 0 to 50% in 3 minutes and up to 100% in less than 5 minutes. Details will be revealed on August 14 at the presentation of the new product

๐ŸŒ๐Ÿ“ฒ @TechnologyBoxs

@python_pioneers
Insertion of List Elements

โžก๏ธ
INSERTION OF LIST ELEMENTS

แŠ แŠ•แ‹ต list แ‹แˆตแŒฅ แŠ แ‹ณแˆต element แ‹จแˆแŠ•แŒจแˆแˆญแ‰ แ‰ต แ‰ฅแ‹™ แŠ แ‹ญแАแ‰ต แˆ˜แŠ•แŒˆแ‹ต แŠ แˆˆแฃ แŠจแŠฅแАแ‹›แˆ แˆ˜แŠ•แŒˆแ‹ถแ‰ฝ แˆแˆˆแ‰ฑแŠ• แŠฅแŠ•แ‹ญแข

1. append() method

แ‹ญแˆ„แŠ•แŠ• method แ‰ แŒ แ‰€แˆ แŠ แŠ•แ‹ต list แ‹แˆตแŒฅ แŠ แ‹ฒแˆต element แˆ˜แŒจแˆ˜แˆญ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แฃ add แ‹จแˆแŠ“แˆจแŒˆแ‹ element แ‹ฐแŒแˆž แ‹จแˆšแŒจแˆ˜แˆจแ‹ แ‹จlistแŠก แˆ˜แŒจแˆจแˆป แˆ‹แ‹ญ แАแ‹แข

Syntax :
list_name.append(new_element)

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

countrys = ["Ethiopia", "Uganda", "France"]
#if I want to add "Kenya" in the list I can use append() and it will add the country's name at the end of the list
countrys.append("Kenya")
print(countrys)

#Output : ["Ethiopia", "Uganda", "France", "Kenya"]

2. insert() method

แ‹ญแˆ„แŠ›แ‹แŠ• method แ‹ฐแŒแˆž แŠ แ‹ฒแˆต element specified แ‹จแˆ†แА แ‰ฆแ‰ณ แˆ‹แ‹ญ แˆˆแˆ›แˆตแŒˆแ‰ฃแ‰ต แˆตแŠ•แˆแˆแŒ แŠฅแŠ•แŒ แ‰€แˆ˜แ‹‹แˆˆแŠ•แข แˆแˆˆแ‰ต argument แŠฅแŠ•แ‹ฐ input แ‹ญแ‹ˆแˆตแ‹ณแˆ one is the index and the other is the element.

An argument refers to the value that is passed to a function or method when it is called.

Syntax :
list_name.insert(i, new_element)

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

countrys = ["Ethiopia", "Uganda", "France"]
#I can use the insert method here to add the country name at specified index

countrys.insert(2, "Kenya")
print(countrys)

#Output : ["Ethiopia", "Uganda", "Kenya", "France"]

...

#Lists
#Python

@python_pioneers
@python_pioneers
Forwarded from Zaphnath Paaneah
Join our channel and embark on your coding journey with us!

๐Ÿ‘‰ @python_pioneers

Gain access to free coding lessons in Amharic language. Additionally, stay updated on the latest tech news and new innovations.

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

@python_pioneers
@python_pioneers
๐Ÿ‘2โค1โšก1
Arranging a List

แ‹จแŠ แŠ•แ‹ตแŠ• list elements order แ‰ แˆแŠ•แˆแˆแŒˆแ‹ แˆ˜แŠ•แŒˆแ‹ต แˆ›แ‹ตแˆจแŒ แŠฅแŠ•แ‰ฝแˆ‹แˆˆแŠ•แฃ แ‹ญแˆ„แŠ•แŠ•แˆ แ‹จแˆแŠ“แˆจแŒˆแ‹ แ‰ แŠฅแАแ‹šแˆ… methods แАแ‹แข

1. sort() method

In a list by default insertion order is preserved แˆ›แˆˆแ‰ตแˆ แˆ˜แŒ€แˆ˜แˆชแ‹ซ แˆ‹แ‹ญ แ‹จlistแŠกแŠ• element แ‰ฃแˆตแ‰€แˆ˜แŒฅแŠ•แ‰ แ‰ต แ‰ฆแ‰ณ แАแ‹ แ‹จแˆแŠ“แŒˆแŠ˜แ‹แข

If we want to sort the elements of the list according to default natural sorting order then we should go for sort() method.

แˆˆ แ‰แŒฅแˆฎแ‰ฝ default natural sorting order ascending order แАแ‹แข
แˆˆ strings default natural sorting order alphabetical order แАแ‹แข

sort() method แˆˆแˆ˜แŒ แ‰€แˆ listแŠก แ‰ฐแˆ˜แˆณแˆณแ‹ญ type แ‹ซแˆ‹แ‰ธแ‹แŠ• elements แˆ˜แ‹ซแ‹ แŠ แˆˆแ‰ แ‰ตแฃ แŠ แˆˆแ‰ แˆˆแ‹แ‹ซ we will get TypeError.

Syntax : 
list_name.sort()

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

yene_list = [4, 5, 3, 1, 2]
yene_list.sort()
print(yene_list)

Output : [1, 2, 3, 4, 5]

2. reverse() method

This method reverses the order of list elements.

Syntax :
list_name.reverse()

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

lela_list = [1, 4, 2, 8, 6]
lela_list.reverse()
print(lela_list)

Output : [8, 6, 4, 2, 1]

...

#Lists
#ArrangingLists

@python_pioneers
@python_pioneers
๐Ÿ‘1
Some programming memes

Have fun๐Ÿ˜Š

@python_pioneers
๐Ÿ˜5