Python 3 Basics | Python Exercise on Lists | Exercise # 4
This video contains list of question or hands on exercise for python developers
How to create empty Lists
output - []
How to create a list that contans elements 11,121,1331,14641,161051
output [11,121,1331,14641,161051]
Task No 1
[11,121,1331,14641,161051]
Assign the first element of list1 to the variable first and print it
first = 11
Task No 2
Assign the last element of list1 to the variable last and print it
last = 161051
Task No 3
Assign the second element of list1 to the variable second and print it
second = 121
Task No 4
Append the value 1771561 to list1 and print the list
input - [11,121,1331,14641,161051]
output - [11,121,1331,14641,161051,1771561]
Task No 5
As we know List can hold different data types, we can add list to a list
so add list2 = ['Squares','Cubes','Tetra','Penta','Hexa'] to the existing list list1
input - [11,121,1331,14641,161051,1771561]
output - [11,121,1331,14641,161051,1771561, ['Squares', 'Cubes', 'Tetra', 'Penta', 'Hexa']]
AND
output - [11,121,1331,14641,161051,1771561,'Squares', 'Cubes', 'Tetra', 'Penta', 'Hexa']
Task No 6
Use Insert Method to add the element at an specfied position
Input -- list1 = [11,121,1331,14641,161051]
Output - list1 = [11,121,1000,1331,14641,161051]
Task No 7
To get the index of the List Items
list1 = [11,121,1331,14641,161051]
what is the index of the element 1331 (answer is 2 but how??)
Task No 8
How to add different type of element to my existing list using append method
input - [11,121,1331,14641,161051]
output - [11,121,1331,14641,161051,'Apple']
Task No 9
How to Remove Element of a list using remove() method
input - [11,121,1331,14641,161051]
output - [11,1331,14641,161051]
Task No 10
How to remove the list element using pop() method
input - [11,121,1331,14641,161051]
output - [11,121,1331,14641]
Task No 11
a. How to reverse Python List using reverse() method and
b. without using reverse() method
Task No 12
How to the get the occurence of a element in a list using count() method
Task No 13
How to add the sum of all the element of a list
input - [10,20,30,40,50]
output - 150
Task No 14
Max function to find the largest number in a list
Input - [11, 121, 1000, 1331, 14641, 161051, 5]
Output - 161051
Task No 15
Min function to find the smallest number in a list
Input - [11, 121, 1000, 1331, 14641, 161051, 5]
Output - 5
Task No 16
How to print the alternate elements of a list
Input - [11, 121, 1000, 1331, 14641, 161051, 5]
Output - [11, 1000, 14641, 5]
Output - [11, 1331, 5]
All Playlist of this youtube channel
==============================
1. Data Preprocessing in Machine Learning
• Data Preprocessing in Machine Learning| Li...
2. Confusion Matrix in Machine Learning, ML, AI
• Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
• Anaconda | Python Installation | Spyder | ...
4. Cross Validation, Sampling, train test split in Machine Learning
• Cross Validation | Sampling | train test s...
5. Drop and Delete Operations in Python Pandas
• Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
• Matrices and Vectors with python
7. Detect Outliers in Machine Learning
• Detect Outliers in Machine Learning
10. Dummy Encoding Encoding in Machine Learning
• Label Encoding, One hot Encoding, Dummy En...
11. Data Visualisation with Python, Seaborn, Matplotlib
• Data Visualisation with Python, Matplotlib...
12. Feature Scaling in Machine Learning
• Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
• Python | Python 3 Basics | Python for Begi...
14. Statistics with Python
• Statistics with Python
15. Sklearn Scikit Learn Machine Learning
• Sklearn Scikit Learn Machine Learning
16. Python Pandas Dataframe Operations
• Python Pandas Dataframe Operations
17. Linear Regression, Supervised Machine Learning
• Linear Regression | Supervised Machine Lea...
18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
• Interview Question for Machine Learning, D...
19. Jupyter Notebook Operations
• Jupyter and Spyder Notebook Operations in ...
20. Logistic Regression in Machine Learning, Data Science
• Logistic Regression | Classification | Mac...
21. Learn Microsoft Excel Basics
• Microsoft Excel 2019, 2016, 2013, 2010, 2007
Информация по комментариям в разработке