Ai Practical File
Ai Practical File
Output:
Hello World
t=7
p= 520
total_amount = t*p
print(total_amount)
Output:
3640
4. Accept the name from the user and greet the user:
5. Accept two numbers from the user and display its sum, product, difference, and
divide:
print(f"Sum: {sum_result}")
print(f"Product: {product_result}")
print(f"Difference: {difference_result}")
print(f"Division: {division_result}")
Output:
Output:
Output:
marks = []
for i in range(5):
mark = float(input(f"Enter marks for subject {i + 1}:
"))
marks.append(mark)
aggregate = sum(marks)
print(f"Aggregate marks: {aggregate}")
Output:
AI HOLIDAY HOMEWORK
Output:
Enter value of a: 5
Enter value of b: 10
After swapping, a = 10.0, b = 5.0
10. Calculate area and perimeter of a rectangle by accepting length and breadth
from the user:
print(f"Area: {area}")
print(f"Perimeter: {perimeter}")
Output:
11. Calculate area and circumference of a circle by accepting radius from the user:
print(f"Area: {area}")
print(f"Circumference: {circumference}")
Output:
12. Input time in seconds and convert into minutes and hours:
minutes = seconds // 60
remaining_seconds = seconds % 60
hours = minutes // 60
remaining_minutes = minutes % 60
Output:
13. Accept Basic + Allow – Deduction = Net salary and calculate net salary:
Output:
14. Calculate BMI after taking height and weight from the user:
Output: