List Comprehension in Python

preview_player
Показать описание
Python Programming: List Comprehension in Python
Topics discussed:
1. Introduction to List Comprehension.
2. The Syntex of List Compreshension.

Music:
Axol x Alex Skrindo - You [NCS Release]

#PythonByNeso #PythonProgramming #ListsInPython
Рекомендации по теме
Комментарии
Автор

home work problem = using for loop list print First char in Capital.
this is by using list comprehension
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animal = [animal.title() for animal in animals]
print(filtered_animal)

harishmahajan
Автор

You must be very good at planning things !! Your videos are extremely organized !! Watching like a Web series !!

dsalgos
Автор

This concept can be used in data scrapping like extracting the data and saving in j.names[ ]
My suggestion is to give examples of code can be used in what scenarios so that interest and concept will be strong for new learners.

izainonline
Автор

Your teaching language owesom 😅 sometimes I forget that you are speaking in English 😅

CHOMUGMING
Автор

Thx and my answer is
filtered_animals= [x.title() for x in animals ]
please let me what's correct answer..

mohammedrezk
Автор

Wow man you explain programming best out of other youtubers ngl

ArianMi
Автор

Homework question answer -:
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
for animal in aminals]
print(filtered_animals)

Harbingersknight
Автор

animals =[ 'lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals=[ animals.tittle() for animal in animals ]
filtered_animals=['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']
When we use tittle() method on string it will do each letter of first character will upper case remaining lower case and it will return string and it doesn't take parameters

jereddymanojkumar
Автор

This is a hard topic, but well explained.

jingersatuh
Автор

ani = ['lion', 'tiger', 'monkey', 'elephant']
ani_2 = [x.title() for x in ani ]
ani_2

suchetrana
Автор

animal = ["lion", "tiger", "monkey", "elephent", "frog"]
Fanimal = [a.title() for a in animal]
print(Fanimal)

RahulSingh-qsed
Автор

#list comprehension(conv. from for loop), shortened list
animals = ['lion', 'tiger', 'python']
for animal in animals]
print(filtered_animals) # Output: ['Lion', 'Tiger', 'Python']

eixinsu
Автор

[animal.title() for animal in animals]

santoshluhar
Автор

list(print("animal.title()" for animal in animals))

Yomdheal
Автор

filtered_animals = [value.title() for value in animals]

dsalgos
Автор

What is the animal.title function and why followed by the ()..
Thanks

asahade
Автор

>>> animals = ["lion", "tiger", "monkey", "elephant", "frog"]
>>> filtered_animals = [animal.title() for animal in animals]
>>> filtered_animals
['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']

jingersatuh
Автор

#Homework
filtered_animals = [animal.title() for animal in animals]
print(filtered_animals)

Movie_in_hindi
Автор

animals = ["lion", "tiger", "elephant", "monkey", "frog"]
animals_2 =[animal.title() for animal in animals]
print(animals_2)

kingR-pn
Автор

Sir can we have python DSA classes please

archanavennela