Question: QUESTION 4: SIMPLE ASCII ART For this next exercise, youll need to complete the function print_ pattern, which, when called with a string of length

 QUESTION 4: SIMPLE ASCII ART For this next exercise, youll needto complete the function print_ pattern, which, when called with a string

QUESTION 4: SIMPLE ASCII ART For this next exercise, youll need to complete the function print_ pattern, which, when called with a string of length 2 1, will print an ASCIl art pattern of concentric diamonds using those characters. Sample input Sample output 1: CODE q4. + New 1 def print_pattern(chars): 2 Sample input 2 print(chars) Xy 4 # don't modify the following code! sif__namemain__': Sample output 2 arg -input() print_pattern(arg) 7 Sample input 3 WXY2 Sample output 3: You ought to find the string join and center methods helpful in your implementation. They are demonstrated here J0in(f'oneto, 'three') one*two*three' >-' . join ( ' abode' "hello.center (11, '*') hello**

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!