Python List Comprehension Exercise for Beginners | Learn Python Programming | part-2 | Data science

preview_player
Показать описание
Transcription:
00:00 1) Find all of the numbers form 1-1000 that are divisible by 7

05:05 2) Count the number of spaces in stings.

09:05 3) Find the common number in two lists, list a =[1,2,3,4],b=[2,3,4,5]

11:40 4) Get only the numbers in a sentence like "In 1984 there were 13 instances of a protest with over 1000 people attending ". Result is a list of number like [ 376, 300]

15:22 5) Find all of the words in a string that are less than 4 letters. String is "On a summer day somner, smith went simming in the sun and his red skin stung"

17:46 6 7 8) Given numbers = range(20), produce a list containing the word 'even' if a number in the numbers is even, and the word 'odd' if the number is odd. Result would look like ['odd','odd', 'even']

25:17 9) Calling functions inside list comprehension

Welcome to our YouTube channel! In this video, we will be diving into the powerful concept of list comprehension in Python, perfect for beginners who are learning Python programming.

List comprehension is a concise and efficient way to create lists in Python, and it can be a powerful tool for writing clean and readable code. In this exercise, we will walk you through step-by-step how to use list comprehensions to create and manipulate lists in Python.

We will start with the basics and gradually progress to more complex examples. You'll learn how to create lists with list comprehensions, use conditional statements to filter elements, and perform operations on each element in a list using list comprehensions. We will also cover common use cases for list comprehensions, such as flattening nested lists and generating mathematical sequences.

This exercise is designed for beginners who have a basic understanding of Python syntax and want to improve their skills in list manipulation. By the end of this video, you will have a solid understanding of list comprehensions and how to use them effectively in your Python programming projects.

Contact with me
1. Instagram:

2. Check out the YouTube channel:

3. LinkedIn:

4. Facebook:

5. GitHub:

6. Kaggle

#ListComprehensionforbeginners
#listinpython
#listcomprehensioninnepali
#list
#pythonprogramminglanguage
#listcomprehension
#artificialintelligence
#deeplearning
#listinhindi
#listcomprehensioninhindi
#pythonlist
#pythonlistcomprehesion
#blockchains
#datascience
#datascientist
#violinplotinhindi
#naivebayes
#MLalgorithm
#mlengineering
#machinelearning
#artificialintelligence
#deeplearning
#blockchains
#iot
#hacking
#hacker
#naiveBayesClassifierAlgorithminHindi
#naiveBayesClassifierAlgorithm
#blackhathacker
#whitehathacker
#pythonlanguage
#sklearn
#pandas
#numpy
#seaborn
Рекомендации по теме