You are on page 1of 1

Alliance Ascent College

BBAIII – ICPL Tutorial Class 27.10.2023


1. Find the factorial of a number
a= int(input(“Enter the number: “))
fact =1
for i in range(1, a+1):
fact = fact *i
print(“Factorial of”, a, “is”, fact)
2. Write a program to print even numbers up to 10
for num in range(2, 10, 2):
print(“Number= “, num)
3. Write a program to generate the Fibonacci series
n = int(input(“Enter the number of terms: “))
f1, f2 = 0, 1
f3 = f1+f2
print(“Fibonacci series of first”, n, “terms”)
print(f1)
print(f2
for i in range (3, n+1):
print(f3)
f1 = f2
f2 = f3
f3 = f1 + f2
4. Write a program that print the following pyramid on the screen. The number of lines
must be obtained from the user as input.
1
22
333
4444
55555
n = int(input(“Enter the step size: “))
for i in range(1, n+1):
for j in range(1, i +1):
print(i, end = ‘ ‘)
print()
5. Write a python program to accept the marks for the three subjects’ math’s, Physics and
Biology for three students and calculate the average marks. If the average marks is >50 ,
print pass and <50, Fail

You might also like