A
Anonymous

Python Output Display - Copy this React, Tailwind Component to your project

Write a python program which displays the count of the names that matches a given pattern from a list of names provided. Consider the pattern characters to be: 1. "_ at" where "_" can be one occurrence of any character 2. "%at%" where "%" can have zero or any number of occurrences of a character Sample Input Expected Output [Hat, Cat, Rabbit, Matter] _at > 2 %at% > 3#lex_auth_01269438070259712046 def count_names(name_list): count1=0 count2=0 #start writing your code here #Populate the variables: count1 and count2 # Use the below given print statements to display the output # Also, do not modify them for verification to work #print("_at > ",count1) #print("%at% > ",count2) #Provide different names in the list and test your program name_list=["Hat","Cat","rabbit","matter"] count_names(name_list)

Prompt
Component Preview

About

PythonOutputDisplay - Easily display name counts matching patterns like "_at" and "%at%". Built with React and Tailwind. Copy code today!

Share

Last updated 1 month ago