Question: In Python using lists: myList=[Hello,name,6,3.1,7.2,9.4,Good Bye,11.1,22] *Write a program that will total the numbers only. (In Python) Ex: to determine type of variable: for item

In Python using lists:

myList=["Hello","name",6,3.1,7.2,9.4,"Good Bye",11.1,22]

*Write a program that will total the numbers only. (In Python)

Ex: to determine type of variable:

for item in theList:

if (type(item) is int):

print ("The item is an integer: ", item)

elif(type(item) is str):

print ("The item is a string: ", item)

elif(type(item) is float):

print ("The item is a float: ", item)

else:

print ("Don't know the type of item")

This program has me utterly lost I appreciate any help I can get.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!