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
🌐📲 @TechnologyBoxs
@python_pioneers
INSERTION OF LIST ELEMENTS
አንድ list ውስጥ አዳስ element የምንጨምርበት ብዙ አይነት መንገድ አለ፣ ከእነዛም መንገዶች ሁለቱን እንይ።
1. append() method
ይሄንን method በጠቀም አንድ list ውስጥ አዲስ element መጨመር እንችላለን፣ add የምናረገው element ደግሞ የሚጨመረው የlistኡ መጨረሻ ላይ ነው።
ለምሳሌ:
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.
ለምሳሌ:
...
#Lists
#Python
@python_pioneers
@python_pioneers
አንድ 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.
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
👉 @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.
ለምሳሌ :
2. reverse() method
This method reverses the order of list elements.
ለምሳሌ :
...
#Lists
#ArrangingLists
@python_pioneers
@python_pioneers
የአንድን 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
Python Pioneers: A Beginner's Guide 🇪🇹
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…
This media is not supported in your browser
VIEW IN TELEGRAM
😁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
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