Write Function Count Number Strings List Tuple Upload Code Canvas Complete Quiz Challenge Q37284320

# Write a function to count the number of strings in a list or tuple.# Upload all the code below to Canvas to complete the quiz/challenge.​def how_many_strings(x): “”” Returns the number of top-level strings in x, where x is a list or tuple. DOES NOT need to count strings that are nested within nested tuples or lists. “”” # Code to complete ​how_many_strings([ 1, “a”, “string”, 6, (7,), [ 5, 6, “boo”] ]) # Correct answer should be 2​ PLEASE USE PYTHON 3!!!!!


Answer


# Write a function to count the number of strings

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.