You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Write a program that takes a list of strings and a string containing a single character, and prints a new list of all the strings containing that character.
#Find Characters
defchar(val, char): #defining function with inputs
new= [] #setting up new array
forxinval:
ifx.find(char) >=0: #this is marking whether or not that character exists within that index
new.append(x) #if it does, add it to the empty array
else:
continue
ifnew!= []: #so if character did exist, then we will print the array
printnew
else: #if the function finds nothing with that character, we can let the user know