Chapter 9 Exercise 2 : Python tutorial 132

preview_player
Показать описание
Guys please help this channel to reach 20,000 subscribers. I'll keep uploading quality content for you.

Python is easy programming language to learn and anyone can learn it, and these tutorials are 100% free in hindi.

You can share this playlist with your brother, sisters and friends. This will surely add some values to their life.

If you follow this complete playlist of python tutorial surely you will learn everything about python programming language.

This is exercise 2 of chapter 9

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

I can told from my learning experiences that you are one of the best teacher in the world. I believe I can be the best programmer if i learn from you. love from Bangladesh.

here is my code which is sorter from other's:-
print(str([i for i in ["a", ("a", 1, 2), {"a":"b"}, ["a", 1, 2], 1, 2, 3] if type(i)==int]))

mahathirmohammad
Автор

def num_to_str(a):
list9 = [str(i) for i in a if (type(i)==int or type(i)==float or type(i)==complex)]
return list9

list_value = [True, False, 'hari', 'krishna', [1, 2, 3], 1, 2.3, 3]
print(num_to_str(list_value))

sagarbhagat
Автор

def
num = [num for num in random_list if (type(num) == int) or (type(num) == float)]
return num

siddharthmalviya
Автор

Solution :

s1 = [True, False, [1,2,3], 1, 1.0, 3]

s2 = [i for i in s1 if type(i) == int or type(i) == float]

print(s2)

NoorMuhammad-dtkf
Автор

list1 = ['String', 12, 4, 4, 4, 8, [1, 2, 4]]
numbers = [num for num in list1 if type(num) == int or type(num) == float ]
print(numbers)

MRGolum
Автор

l=[1, 2, 3.4, [4, "aman"]]
s=[str(i) for i in l if type(i)==int or type(i)==float]
print(s)




"other way"
l=[1, 2, 3.4, [4, "aman"]]
s=[]
for i in l:
if type(i)==int:
s.append(str(i))
elif type(i)==float:
s.append(str(i))
print(s)

amangupta-fqrs
Автор

def takeNums(ls):
strNums = [str(s) for s in ls if type(s) == int or type(s) == float]
return strNums


a = takeNums(["str", 5.6, 20, 7, True, False, "bl", 7])
print(a)

muzik
Автор

#Hello Harshit Bhai
def number_str(strings):

user_input=[True, False, 10, 30, 2.5, 57, 'Ali']
print(number_str(user_input))

learnfun
Автор

Write a code which will take a input and print whether input is letter or symbol or number or word????
How can I do this? please help

animeshbanerjeevlogs
Автор

list=[True, False, [1, 2, 3], 1, 1.0, 3]


def string_list(l):
return [str(i) for i in l if type(i)==int or type(i) == float]

print(string_list(list))

sugandhbansal
Автор

names=[True, False, [1, 2, 3], 1, 1.0, 3]
print([str(item) for item in names if (type(item)==int or type(item)==float)])

shubhamsharma-dbzx
Автор

# NUM TO STRING
myList=[True, False, [10, 15, 0], 1.0, 5, 3, 5]
output=[str(i) for i in myList if type(i)==int or type(i)==float]
print(output)

gauravjha
Автор

l =[1, 2, 3, 4.0, (10, 22, 45), ["k", "l"], {1:100, 2:80}, True, "hi"]
x=[i for i in l if type(i)==int or type(i)==float]
print(x)

subhashriroy
Автор

solutioN:
list = [True, False, [1, 2, 3], 1, 1.0, 3]
def soyeb(l):
newlist = [ i for i in l if type(i)==int or type(i)==float]
print (newlist)
soyeb(list)

soyeb
Автор

x = [True, False, [1, 2, 3], 1, 1.0, 3]
y = [str(i) for i in x if type(i) == int or type(i) == float]
print(y)

yu_a_vi
Автор

print([str(i) for i in ['abc', [1, 2, 3], 1, 4, 3.0] if type(i)== int or type(i)==float])

rmeena
welcome to shbcf.ru