Python_12345
Python_12345
AIM:
The aim of the program is to calculate the area of a circle using a constant value for pi and
user input for the radius.
ALGORITHM:
Step 4: Calculate the area of the circle using the formula area = PI * radius * radius.
CODING:
PI = 3.14159
OUTPUT:
AIM:
The aim of the program is to perform basic arithmetic operations using operators in
Python.
ALGORITHM:
CODING:
print("Addition:", result)
print("Subtraction:", result)
print("Multiplication:", result)
print("Division:", result)
print("Modulo:", result)
print("Exponentiation:", result)
OUTPUT:
Enter the first number: 10
Addition: 13.0
Subtraction: 7.0
Multiplication: 30.0
Division: 3.3333333333333335
Modulo: 1.0
Exponentiation: 1000.0
AIM:
The aim of the program is to determine whether a given number is positive, negative, or zero
using conditional statements in Python.
ALGORITHM:
CODING:
if number > 0:
if number==0:
print(‘Number is 0’)
else:
print(‘Number is Positive’)
else:
print(‘Number is Negative’)
OUTPUT:
Enter a number: 5
Number is Positive
Enter a number: -2
Number is Negative
Enter a number: 0
Number is 0
AIM:
The aim of the program is to display the factorial of given number using loop in Python.
ALGORITHM:
CODING:
factorial=1
for i in range(1,n+1):
factorial*=i
OUTPUT:
Enter a Number:5
Factorial of 5 is 120
AIM:
The aim of the program is to demonstrate the use of jumping statements in Python.
ALGORITHM:
Step 2: Inside the loop, check if the number is greater than 500.
CODING:
number=[1,2,3,4,5,6,7]
if num == 6:
break
Print(number)
OUTPUT:
75
145
150