Question: Scenario Given a list, an array, or other data structure that includes a number of different data types, you want to be able to filter

 Scenario Given a list, an array, or other data structure that

Scenario

Given a list, an array, or other data structure that includes a number of different data types, you want to be able to filter out all of the integers and give an output of the remaining bits of data.

Aim

Write a function that receives a number of arguments; using a continue statement, skip integers and print out all other values.

Steps for Completion

  1. Define a function named skip_integers, with a variable number of arguments.

  2. Use a for loop to iterate over the arguments.

  3. Use a check to see whether the value passed is of the integer type. If it is, use the continue statement to ignore it.

  4. Print the arguments.

The output should be as shown in Snippet 4.30:

5.2 value 6.0

Lab Activity 4.3: Function Arguments Function Arguments 11 Scenario Given a list, an array, or other data structure that includes a number of different data types, you want to be able to filter out all of the integers and give an output of the remaining bits of data. main.py + 1 def skip_integers (*k): 2 for i in k: 3 if isinstance(i,int):#check if it is integer 4 continue 5 else: 6 print(i) 7 8 skip_integers(3,5.2,"value", 6.0)#call function 9 Aim Write a function that receives a number of arguments; using a continue statement, skip integers and print out all other values. Steps for Completion 1. Define a function named skip_integers, with a variable number of arguments. 2. Use a for loop to iterate over the arguments. 3. Use a check to see whether the value passed is of the integer type. If it is, use the continue statement to ignore it. 4. Print the arguments. The output should be as shown in Snippet 4.30: 5.2 value 6.0 Snippet 4.30

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!