[SOLVED] BBM103-Quiz 6

24.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Problem1: Diamond-Printing Program using Recursion

Write a program that prints the following diamond shape corresponding to the input value using recursion.

Take to input value as an argument shown as below:

>>> python3 quiz6-1.py 5

*

***

*****

*******

*********

*******

*****

***

*

Problem2: Diamond-Printing Program using Comprehension.

Write a program that prints the following diamond shape corresponding to the input value using comprehension. There is no restrictions on using comprehension methods.(list,set or dictionary comprehension).

Take to input value as an argument shown as below:

>>> python3 quiz6-2.py 5

*

***

*****

*******

*********

*******

*****

***

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.