Cs practical file class 11 th
Cs practical file class 11 th
2
Chhindwara
Signature:
Pratical
1) Multiplication table of a given number
num = int(input("Enter a number: "))
Output:
Enter a number: 5
Multiplication Table of 5:
5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
Output:
Arithmetic Operations:
25 + 10 = 35
25 - 10 = 15
25 * 10 = 250
25 / 10 = 2.5
25 // 10 = 2
25 % 10 = 5
25 ** 10 = 95367431640625
Output:
Enter the first number: 10
average_marks = total_marks / 5
grade = "A+"
grade = "A"
grade = "B"
grade = "C"
grade = "D"
else:
grade = "Fail"
print(f"Name: {name}")
print(f"Percentage: {percentage:.2f}%")
print(f"Grade: {grade}")
print("***************************************")
Output:
Enter Student Name: Rahul Sharma
Percentage: 86.60%
Grade: A
***************************************
temp = num1
num1 = num2
num2 = temp
Output:
Enter the first number: 10
if num % 2 == 0:
else:
Output:
Enter a number: 15
15 is an Odd number.
end = 7
Output:
The sum of natural numbers from 1 to 7 is: 28
print("Simple Calculator")
if operator == '+':
else:
print(f"Result: {result}")
calculator()
Output:
Simple Calculator
Operations: +, -, *, /, //, %, **
Result: 50.0
output:
*
**
***
****
*****
10) Write a program to check weather the entered year is leap year or not.
year = int(input("Enter a year: "))
else:
Output:
Enter a year: 2024
2^5 = 32
fib_series.append(fib_series[-1] + fib_series[-2])
fib_tuple = fibonacci(9)
Output:
Fibonacci Tuple: (0, 1, 1, 2, 3, 5, 8, 13, 21)
single_value_tuple = (value,)
Output:
Enter a value: 10
largest = max(sequence)
smallest = min(sequence)
numbers_tuple = tuple(numbers)
Output:
Enter numbers separated by space: 5 8 2 9 1 7
Largest: 9, Smallest: 1
Largest: 9, Smallest: 1