Skip to content

Commit 7e4e2c4

Browse files
Merge pull request #2 from KaifKhan7393/main
Added some basic questions
2 parents 57f3654 + 7a1a8d0 commit 7e4e2c4

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

Multiplication_Table.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def multiplicationTable(n, i=1):
2+
if i == 11:
3+
return
4+
print(n, 'x', i, '=', n*i)
5+
multiplicationTable(n, i+1)
6+
7+
n = int(input("Enter the number:"))
8+
multiplicationTable(n)

power_of_a_number.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def power_of_a_linear(x, n):
2+
if n == 0:
3+
return 1
4+
return x * power_of_a_linear(x, n-1)
5+
6+
x = int(input("Enter the number:"))
7+
n = int(input("Enter the power:"))
8+
print(power_of_a_linear(x, n))

print_decreasing_number.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def printDecreasing(n):
2+
if n == 0:
3+
return
4+
print(n)
5+
printDecreasing(n-1)
6+
7+
n = int(input("Enter the number:"))
8+
printDecreasing(n)
9+

print_incerasing_number.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def printIncreasing(n):
2+
if n == 0:
3+
return
4+
printIncreasing(n-1)
5+
print(n)
6+
7+
n = int(input("Enter the number:"))
8+
printIncreasing(n)

0 commit comments

Comments
 (0)