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)
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=[ 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
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)
Thx and my answer is
filtered_animals= [x.title() for x in animals ]
please let me what's correct answer..
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.
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()
Wow man you explain programming best out of other youtubers ngl
Your teaching language owesom 😅 sometimes I forget that you are speaking in English 😅
😂
😂 same situation
I like his teaching and voice....ty brother 😂😂
This is a hard topic, but well explained.
i like this explanation
animals=["lion","tiger","monkey","elephant","frog"]
filtered_animals=[animal.title() for animal in animals]
print(filtered_animals)..
thanks neso academy
please make a detailed step by step video on Transpose of matrix topic in python. 🙏
Osm teaching nice explanation ❤❤❤
[animal.title() for animal in animals]
I was gonna comment the same!
Homework question answer -:
animals = ['lion' , 'tiger' , 'monkey' , 'elephant' , 'frog']
filtered_animals=[animal.title() for animal in aminals]
print(filtered_animals)
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)
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
i'm not able to run list comprehension example .
me too
thanks!
Sir can we have python DSA classes please
sir new list append ethods kar sath hai
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']
Ans:
```
animals = ['lion', 'tiger','monkey','elephant','frog']
filtered_animals = [animal.title() for animal in animals ]
print(filtered_animals)
```
list(print("animal.title()" for animal in animals))
filtered_animals = [animal.title() for animal in animals]
filtered _animals
Enter
List comprehension answer!!
fa=[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']
>>>
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']
Super
filtered_animals = [ "animal title() " for animal in animals]
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals = [animal.title() for animal in animals]
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", "elephant", "monkey", "frog"]
animals_2 =[animal.title() for animal in animals]
print(animals_2)
#Homework
filtered_animals = [animal.title() for animal in animals]
print(filtered_animals)
First
animals = ['lion','tiger','monkey']
f_animals = [animal for animal in animals]
print(f_animals)
animals=['lion', 'tiger','monkey','elephant','frog' ]
update_animals=[animal.title() for animal in animals ]
print(update_animals)
animals = ['lion', 'tiger', 'monkey', 'elephant', 'frog']
filtered_animals = [ ]
filtered_animals = [name.title( ) for name in animals]
print(filtered_animals)
ani = ['lion', 'tiger', 'monkey','elephant']
ani_2 = [x.title() for x in ani ]
ani_2
name for name in names if "J" in name... You could think of anything more complex🤣
filtered_animals=[animal.title()for animal in animals]
animals = ["lion", "tiger", "elephant", "monkey", "frog"]
animals_2 =[animal.title() for animal in animals]
print(animals_2)
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]