β€5
α α΅α°ααͺ α³αͺα αα α α΅αα΅α΅ α αα₯α‘α΅What a Waste:
A mother camel and her baby were lying down, soaking up the sun. The baby camel asked his mom, βWhy do we have these big bumps on our back?β
The mom stopped to think and then said, βWe live in the desert where there is not much water available. Our humps store water to help us survive on long journeys. β
The baby camel then stopped to think and said, βWell, why do we have long legs with rounded feet?β
His mother replied, βThey are meant to help us walk through sand.β
The baby asked a third question, βWhy are my eyelashes so long?β
The mother replied, βYour long eyelashes offer you protection from sand when it blows in the wind.β
Finally, the baby said, βIf we have all of these natural abilities given to us to walk through the desert, whatβs the use for camels in the Zoo?β
The Moral:
The skills and abilities that you possess wonβt be useful if youβre not in the right environment.
Youβve probably heard of a professional who ditched his or her career to follow their dreamsβor the person who remains unfulfilled in their job, but doesnβt try to make a change.
If youβre stuck in a career that isnβt the right fit, you have to do some self-reflection to realize where your strengths lie that are going to waste. Turn to people that you know the best as well as professionals in any given market so you can start thinking about what may be better for you. Think big and remain open to new ideas.
#EnglishStories
#Inspiration
@python_pioneers
@python_pioneers
β€4
Python Pioneers: A Beginner's Guide πͺπΉ
α α΅α°ααͺ α³αͺα αα α α΅αα΅α΅ α αα₯α‘α΅ What a Waste: A mother camel and her baby were lying down, soaking up the sun. The baby camel asked his mom, βWhy do we have these big bumps on our back?β The mom stopped to think and then said, βWe live in the desert where thereβ¦
The skills and abilities that you possess wonβt be useful if youβre not in the right environment.
ααα«α αα½α΅ ααααα½α!
#Quotes
@python_pioneers
β€6
β‘οΈβ
Next : Accessing a List in Python
βοΈ8 : 30 EAT
...
Next : Accessing a List in Python
βοΈ8 : 30 EAT
...
Accessing Lists in Python
α Python α΅α list αααα΅α α£α αͺα«α΅ ααα α°αα α₯αα΄α΅ α₯αα°ααα α© α αα°α αα αα’ α αα α°αα α¨α αα΅ list content α₯αα΄α΅ access αα¨α α₯αα°ααα½α α₯αα«ααα’
List access ααα¨α α¨ααα αααΈα αα° 3 ααααΆα½ α αα‘
1. By using indexing
Indexing ααα΅ α¨α αα΅α list element point α¨ααα¨αα α΅ αααα΅ ααα’
Accessing the elements by index ααα΅, elements α listα‘ αα΅α₯ α£αα α΅ α¦α³ access α²α°α¨α ααα’ Index α°αα α¨αααα¨α α¨0 ααα’ α« ααα΅ α¨α αα΅ list first element index αα₯α© 0 ααα’
List index positive α negative α ααα αα½ααα’ Positive index indexing α¨αα« αα°αα α₯αα°αα αααα¨αα α α°αα«αα α°αα negative index α¨αα αα° αα« represent α«α¨ααα’
...to be contd
#AccessingLists
#Indexing
@python_pioneers
α Python α΅α list αααα΅α α£α αͺα«α΅ ααα α°αα α₯αα΄α΅ α₯αα°ααα α© α αα°α αα αα’ α αα α°αα α¨α αα΅ list content α₯αα΄α΅ access αα¨α α₯αα°ααα½α α₯αα«ααα’
List access ααα¨α α¨ααα αααΈα αα° 3 ααααΆα½ α αα‘
1. By using indexing
Indexing ααα΅ α¨α αα΅α list element point α¨ααα¨αα α΅ αααα΅ ααα’
Syntax :
list_name[index_number]
Accessing the elements by index ααα΅, elements α listα‘ αα΅α₯ α£αα α΅ α¦α³ access α²α°α¨α ααα’ Index α°αα α¨αααα¨α α¨0 ααα’ α« ααα΅ α¨α αα΅ list first element index αα₯α© 0 ααα’
List index positive α negative α ααα αα½ααα’ Positive index indexing α¨αα« αα°αα α₯αα°αα αααα¨αα α α°αα«αα α°αα negative index α¨αα αα° αα« represent α«α¨ααα’
...to be contd
#AccessingLists
#Indexing
@python_pioneers
Python Pioneers: A Beginner's Guide πͺπΉ
Accessing Lists in Python α Python α΅α list αααα΅α α£α
αͺα«α΅ ααα α°αα α₯αα΄α΅ α₯αα°ααα α© α αα°α αα αα’ α αα α°αα α¨α αα΅ list content α₯αα΄α΅ access αα¨α α₯αα°ααα½α α₯αα«ααα’ List access ααα¨α α¨ααα αααΈα αα° 3 ααααΆα½ α αα‘ 1. By using indexing Indexing ααα΅ α¨α αα΅α list element point α¨ααα¨αα α΅β¦
...contd
Examples: Accessing Elements
First Element:
Last Element:
Third Element:
#Indexing
#Examples
#Lists
@python_pioneers
Examples: Accessing Elements
First Element:
my_list = [10, 20, 30, 40, 50]
print(my_list[0]) # Output: 10
Last Element:
print(my_list[-1]) # Output: 50
Third Element:
print(my_list[2]) # Output: 30
#Indexing
#Examples
#Lists
@python_pioneers
π2
2. Accessing List Using Slicing Operator
Slicing ααα΅ α¨α αα΅α main list sublist ααα α¨αααααΈαα elements ααα°α α¨αααα£α α΅ αααα΅ ααα’
start : Sliceα‘ α¬α΅ α₯αα°αααα represent α«α¨αα, default value 0 ααα’
stop : represents the end index where slice should end.
β«οΈallow α¨αα°α¨α max value = (last index + 1 )
β«οΈααα value α«αα°α°α α α¨ listα‘α last element index as default ααα΅α³αα’
step : slice α αα°α¨α elements ααα¨α α«ααα index value increment represent α«α¨αα
α αα΅α list slice α ααα α¨ααααα αα list ααα’
i.e. it returns a list.
...ααα₯αα π
#Slicing
#Lists
@python_pioneers
Slicing ααα΅ α¨α αα΅α main list sublist ααα α¨αααααΈαα elements ααα°α α¨αααα£α α΅ αααα΅ ααα’
Syntax :
list_name[start : stop : step]
start : Sliceα‘ α¬α΅ α₯αα°αααα represent α«α¨αα, default value 0 ααα’
stop : represents the end index where slice should end.
β«οΈallow α¨αα°α¨α max value = (last index + 1 )
β«οΈααα value α«αα°α°α α α¨ listα‘α last element index as default ααα΅α³αα’
step : slice α αα°α¨α elements ααα¨α α«ααα index value increment represent α«α¨αα
α αα΅α list slice α ααα α¨ααααα αα list ααα’
i.e. it returns a list.
...ααα₯αα π
#Slicing
#Lists
@python_pioneers
π2
Goodnight ππ€π€
π4
Programming Jokes!!!
1 : A guy walks into a bar and asks for 1.014 root beers.
The bartender says, βIβll have to charge you extra, thatβs a root beer floatβ.
So the guy says, βIn that case, better make it a double.β
2 : 3 Database SQL walked into a noSQL bar
A little while later....
They walked out
Because they COULDN'T FIND A TABLE
3 : The Programmer wife sent him to a grocer store.
Her instructions were "Buy Butter. See if they have eggs, If they do buy 10"
4 : Q: Why do Java Programmers wear glasses?
A: Because they can't C#
Real Programmers don't comment their codes!!
Because If it was hard to write.....
It must be hard to read....
Algorithm : word used by programmers when they do not want to explain
what they did
Keep Calm and LOVE programming!!!!!
Sololearn
#Jokes
@python_pioneers
@python_pioneers
1 : A guy walks into a bar and asks for 1.014 root beers.
The bartender says, βIβll have to charge you extra, thatβs a root beer floatβ.
So the guy says, βIn that case, better make it a double.β
2 : 3 Database SQL walked into a noSQL bar
A little while later....
They walked out
Because they COULDN'T FIND A TABLE
3 : The Programmer wife sent him to a grocer store.
Her instructions were "Buy Butter. See if they have eggs, If they do buy 10"
4 : Q: Why do Java Programmers wear glasses?
A: Because they can't C#
Real Programmers don't comment their codes!!
Because If it was hard to write.....
It must be hard to read....
Algorithm : word used by programmers when they do not want to explain
what they did
Keep Calm and LOVE programming!!!!!
Sololearn
#Jokes
@python_pioneers
@python_pioneers
Sololearn
Programming Jokes!!! | Sololearn: Learn to code for FREE!
1 : A guy walks into a bar and asks for 1.014 root beers.
The bartender says, βIβll have to charge you extra, thatβs a root beer floatβ.
So the guy says
The bartender says, βIβll have to charge you extra, thatβs a root beer floatβ.
So the guy says
Exercises
Deepen Your Knowledge About List Indexing and Slicing Through These Questionsπ
1β£. What will be the output of the following code?
a)
b)
c)
d)
my_list = [10, 20, 30, 40, 50]
print(my_list[1:4])
a)
[10, 20, 30] b)
[20, 30, 40] c)
[20, 30, 40, 50] d)
[30, 40, 50]2β£. Given the list
, what does
return?
a)
b)
c)
d)
my_list = ['a', 'b', 'c', 'd', 'e']
, what does
my_list[-3:]
return?
a)
['a', 'b', 'c'] b)
['c', 'd', 'e'] c)
['d', 'e']d)
['e']3β£. What will be the output of the following code?
a)
b)
c)
d)
my_list = [1, 2, 3, 4, 5, 6]
print(my_list[::2])
a)
[1, 2, 3, 4, 5, 6] b)
[1, 3, 5] c)
[2, 4, 6] d)
[6, 5, 4, 3, 2, 1]4β£. Which of the following will give you a reversed copy of the list
a)
b)
c)
d)
my_list?a)
my_list[::-1] b)
my_list.reverse() c)
reversed(my_list) d)
my_list[:-1]5β£. What does the slice
a) Returns a list with the first and last elements removed
b) Returns the entire list
c) Returns a list with the first element removed
d) Returns a list with the last element removed
my_list[1:-1] do?a) Returns a list with the first and last elements removed
b) Returns the entire list
c) Returns a list with the first element removed
d) Returns a list with the last element removed
6β£. What will be the output of the following code?
a)
b)
c)
d)
my_list = [5, 10, 15, 20, 25, 30]
print(my_list[1:5:2])
a)
[10, 20] b)
[10, 15, 20, 25] c)
[10, 20, 30] d)
[10, 25]