TORONTO KIDS COMPUTER CLUB | PMCA Sunday 12:00 Python Homework 20.10.11.
18463
post-template-default,single,single-post,postid-18463,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

PMCA Sunday 12:00 Python Homework 20.10.11.

16 Oct PMCA Sunday 12:00 Python Homework 20.10.11.

Question 1:
Create the following * pattern image base on your input


Hint:
Remember when we multiply a string by a number, the string is repeated the number times.

>>> '*' * 10
'**********'

Also you would need 2 for loops to solve the question


Sample Input 1:
3
Sample Output 1:
***
**
*
*
**
***

Sample Input 2:
5
Sample Output 2:
*****
****
***
**
*
*
**
***
****
*****

Sample Input 3:
1
Sample Output 3:
*
*

Sample Input 4: 
2 
Sample Output 4: 
** 
* 
* 
**


Question 2:
Create the following * pattern image base on your input

Sample Input 1:
3
Sample Output 1:
*
**
***
***
**
*

Sample Input 2:
5
Sample Output 2:
*
**
***
****
*****
*****
****
***
**
*
No Comments

Sorry, the comment form is closed at this time.