Ask your own question, for FREE!
Computer Science 19 Online
kekeman:

You are given a mixed list containing strings, numbers, and other lists, like the following: ["apple", 1, [2, 3], 3.4, "toy", ["cat", "dog"]]. You are writing a program to print the string items only. What is the missing line in the code below? def get_strings(list): for a in list: /**missing code**/ print(a) get_strings(["apple", 1, [2, 3], 3.4, "toy", ["cat", "dog"]]) if a == str: if a == str(a): if a != int(a): if a is string:

kekeman:

I was most definally thinking "if a == str(a):"

kekeman:

Another question: After you have found out how to find a prime number from a given set of numbers, what is the next step in designing a program? Analyzing the hardware requirements for the coding Selecting the best data structure to store numbers Studying the literature that deals with the prime numbers Typing a pseudocode that provides the solution

SmokeyBrown:

@kekeman wrote:
I was most definally thinking "if a == str(a):"
Yeah, I think that could work

SmokeyBrown:

@kekeman wrote:
Another question: After you have found out how to find a prime number from a given set of numbers, what is the next step in designing a program? Analyzing the hardware requirements for the coding Selecting the best data structure to store numbers Studying the literature that deals with the prime numbers Typing a pseudocode that provides the solution
I would say the very next step after figuring out the process that a program takes to get to a solution would usually be to organize that solution in the form of pseudocode

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!