filmov
tv
Python Exercise#11

Показать описание
Try to solve an exercise based on List and List Slicing.
I will recommend to watch the last 2 session.
Questions:
### List Exercise:
numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
#-----------------------------------------------------------------------------------------
### Q-1.) print(numbers[1:-4:2])
#### Ans:______
#-----------------------------------------------------------------------------------------
### Q-2.) print(numbers[::5-3])
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-3.) print(numbers[::-2*2])
#### Ans:___
### Q-4.) what will be the output of this statement numbers[3::2] = "C++"
### Ans:____
#-----------------------------------------------------------------------------------------
### Q-5.) numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
### numbers[6:] = "C++"
### print(numbers)
#### Ans: ____
#-----------------------------------------------------------------------------------------
### Q-6.) numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
### numbers[::3] = [3,3,3]
#### Ans:_____
#-----------------------------------------------------------------------------------------
### Q-7.) what is difference between append and extend of the list?
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-8.) What is difference between remove, pop?
### Ans:____
#-----------------------------------------------------------------------------------------
### Q-9) List is mutable data structure.
a.) True
b.) False
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-10) We can store integer, float, string or other data structure in the list.
a.) True
b.) False
#### Ans:______
I will recommend to watch the last 2 session.
Questions:
### List Exercise:
numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
#-----------------------------------------------------------------------------------------
### Q-1.) print(numbers[1:-4:2])
#### Ans:______
#-----------------------------------------------------------------------------------------
### Q-2.) print(numbers[::5-3])
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-3.) print(numbers[::-2*2])
#### Ans:___
### Q-4.) what will be the output of this statement numbers[3::2] = "C++"
### Ans:____
#-----------------------------------------------------------------------------------------
### Q-5.) numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
### numbers[6:] = "C++"
### print(numbers)
#### Ans: ____
#-----------------------------------------------------------------------------------------
### Q-6.) numbers = [10,30,40,56,70,80,90,20,44,67,57,48]
### numbers[::3] = [3,3,3]
#### Ans:_____
#-----------------------------------------------------------------------------------------
### Q-7.) what is difference between append and extend of the list?
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-8.) What is difference between remove, pop?
### Ans:____
#-----------------------------------------------------------------------------------------
### Q-9) List is mutable data structure.
a.) True
b.) False
#### Ans:____
#-----------------------------------------------------------------------------------------
### Q-10) We can store integer, float, string or other data structure in the list.
a.) True
b.) False
#### Ans:______
Комментарии