Description
1. Write a Python program that accepts an integer (n) and computes the value of n + nn + nnn + … + (n multiplied n times).
“`
Sample input : 3 Output : 39
Sample input : 4
Output : 340
“`
2. Given an integer n, print a nXn matrix with squares (outermost to innermost) having values n, then n-1 and so on.
For example, given 5, output is:
“`
5 5 5 5 5
5 4 4 4 5
5 4 3 4 5
5 4 4 4 5
5 5 5 5 5
“`
3. Write a python program to print this pattern:
For n = 5:
“`
*
***
*****
*******
*********
“`
4. Write a python program to print this pattern:
For n = 5:
“`
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
“`
5. Solve all questions here: https://www.hackerrank.com/domains/python/pyintroduction
Reviews
There are no reviews yet.