PWP Practical No. 5
PWP Practical No. 5
b.
*
***
*****
***
*
k = rows - 2
for i in range(rows, -1, -1):
for j in range(k, 0, -1):
print(end=" ")
k=k+1
for j in range(0, i + 1):
print("* ", end="")
print("")
c.
1010101
10101
101
1
2. Write a Python program to print all even numbers between 1 to 100 using
while loop.
i=0
while i < 100:
i += 2
print("Even Number is :",i)
3. Write a Python program to find the sum of first 10 natural numbers using for
loop.
number = int(input("Please Enter any Number: \n "))
total = 0