Question: help with this please You are given a list variable named x that contains items of various data types. Write a while loop that prints
You are given a list variable named x that contains items of various data types. Write a while loop that prints only those items that are of type float-or- of type string. Hint: Python has a type() function that returns the type of an object. You can use branching to test the type of each item. Here are predefined data type names that you can compare to: int, float, str. list, tuple Example: If x=[ "bob", 3, 5, "Hi!", 3.5, 9, 6.2, 3] then your loop should print this: bob Hi ! 3.5 6.2 You are given a variable N that contains a positive integer value. Using just a single for loop, print out the integers from 0 to N and from N to 0 , paired up side-by-side like in the following examples. Note: You do not need lists or arrays to do this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
