π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
Here are some multiple choice questions: Answer them by reacting for the correct ones as stated below π
A == π
B == π
C == π’
D == π€
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
Forwarded from Python Pioneers: A Beginner's Guide πͺπΉ
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 π
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?
π) 5
π) 10
π’) 25
π€) 20
numbers = [5, 10, 15, 20, 25]
print(max(numbers))
π) 5
π) 10
π’) 25
π€) 20
π’6
4. What will be the output of the following code?
π) 9
π) 4
π’) 3
π€) 5
numbers = [3, 7, 2, 9, 4]
print(len(numbers))
π) 9
π) 4
π’) 3
π€) 5
π€3
5. What will be the output of the following code?
π) "apple"
π) "banana"
π’) "orange"
π€) "kiwi"
words = ["apple", "banana", "orange", "kiwi"]
print(max(words))
π) "apple"
π) "banana"
π’) "orange"
π€) "kiwi"
π1
6. What will be the output of the following code?
π) "cat"
π) "bird"
π’) "sheep"
π€) "elephant"
words = ["cat", "sheep", "elephant", "bird"]
print(min(words, key=len))
π) "cat"
π) "bird"
π’) "sheep"
π€) "elephant"
π2π€1