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)
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
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.
animals=["lion","tiger","monkey","elephant","frog"] filtered_animals=[animal.title() for animal in animals] print(filtered_animals).. thanks neso academy
#list comprehension(conv. from for loop), shortened list animals = ['lion', 'tiger', 'python'] filtered_animals=[animal.title() for animal in animals] print(filtered_animals) # Output: ['Lion', 'Tiger', 'Python']
You must be very good at planning things !! Your videos are extremely organized !! Watching like a Web series !!
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)
You are simply fantastic,Thank you
Thank you very much neso academy for helping to understand this topic❤❤
Wow man you explain programming best out of other youtubers ngl
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
*animal.tittle()
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 hello . Do you have a Channel..? Thanks for the tip.
Your teaching language owesom 😅 sometimes I forget that you are speaking in English 😅
😂
😂 same situation
I like his teaching and voice....ty brother 😂😂
Thx and my answer is
filtered_animals= [x.title() for x in animals ]
please let me what's correct answer..
This is a hard topic, but well explained.
animals=["lion","tiger","monkey","elephant","frog"]
filtered_animals=[animal.title() for animal in animals]
print(filtered_animals)..
thanks neso academy
i like this explanation
please make a detailed step by step video on Transpose of matrix topic in python. 🙏
Homework question answer -:
animals = ['lion' , 'tiger' , 'monkey' , 'elephant' , 'frog']
filtered_animals=[animal.title() for animal in aminals]
print(filtered_animals)
thanks!
Osm teaching nice explanation ❤❤❤
Very helpful, thanks :)
#list comprehension(conv. from for loop), shortened list
animals = ['lion', 'tiger', 'python']
filtered_animals=[animal.title() for animal in animals]
print(filtered_animals) # Output: ['Lion', 'Tiger', 'Python']
animal = ["lion","tiger","monkey","elephent","frog"]
Fanimal = [a.title() for a in animal]
print(Fanimal)
filtered_animals = [animal.title() for animal in animals]
filtered _animals
Enter
List comprehension answer!!
What is the animal.title function and why followed by the ()..
Thanks
it's a string method used to convert a first character of a string to an uppercase then the rest are converted to lowercase characters
[animal.title() for animal in animals]
I was gonna comment the same!
fa=[animal.title() for animal in animals]
Ans:
```
animals = ['lion', 'tiger','monkey','elephant','frog']
filtered_animals = [animal.title() for animal in animals ]
print(filtered_animals)
```
Super
Sir can we have python DSA classes please
filtered_animals=[animal.title() for animal in animals ]
animals= ['lion','tiger','monkey','elephant','frog']
filtered_animals=[animal.title() for animal in animals]
print(filtered_animals)
output: ['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']
list(print("animal.title()" for animal in animals))
filtered_animals = [value.title() for value in animals]
>>> animals = ["lion", "tiger", "monkey", "elephant", "frog"]
>>> filtered_animals = [animal.title() for animal in animals]
>>> filtered_animals
['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals = [animal.title() for animal in animals]
ani = ['lion', 'tiger', 'monkey','elephant']
ani_2 = [x.title() for x in ani ]
ani_2
animals = ["lion", "tiger", "elephant", "monkey", "frog"]
animals_2 =[animal.title() for animal in animals]
print(animals_2)
sir new list append ethods kar sath hai
i'm not able to run list comprehension example .
me too
filtered_animals = [ "animal title() " for animal in animals]
>>>animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
>>>Filtered _animals = [animal_title() for animal in animals]
>>>Filtered _animals
['lion', 'tiger', 'monkey', 'elephant', 'frog']
>>>
animal = [i.title() for i in animals]
animal
['Lion', 'Tiger', 'Monkey', 'Elephant', 'Frog']
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals = [animal.title() for animal in animals ]
print(filtered_animals)
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals = [ ]
filtered_animals = [name.title( ) for name in animals]
print(filtered_animals)
animals=['lion', 'tiger','monkey','elephant','frog' ]
update_animals=[animal.title() for animal in animals ]
print(update_animals)
animals = ['lion','tiger','monkey']
f_animals = [animal for animal in animals]
print(f_animals)
#Homework
filtered_animals = [animal.title() for animal in animals]
print(filtered_animals)
First
name for name in names if "J" in name... You could think of anything more complex🤣
animals = ["lion", "tiger", "elephant", "monkey", "frog"]
animals_2 =[animal.title() for animal in animals]
print(animals_2)
filtered_animals=[animal.title()for animal in animals]
animals = ['lion', 'tiger', 'monkey','elephant','frog']
filtered_animal = [ animal.title() for animal in animals ]
print(filtered_animal)
filtered_animals = [animal.title() for animal in animals]
filtered_animals = [animal.title() for animal in animals]
filtered_animals = [animal.title() for animal in animals]
filtered_animals = [animal.title() for animal in animals]
filtered_animals=[animal.title() for animal in animals]
filtered_animals = [animal.title() for animal in animals]