CHANDAN KUMAR Assignment - 01
CHANDAN KUMAR Assignment - 01
Ans :- We use here Heron’s formula to find the area of triangle when
the lengths of all three sides are known. Heron’s formula states that
the area (A) of triangle with sides of lengths ‘a’, ‘b’ and ‘c’ is given by:
Output :-
ii) x = -b + b2 -4ac.
Ans :- Below are the equivalent python code for this expression :
import cmath # Import the complex math module for handling complex roots
Output : -
6. Write a Python program to Enter any Number and print how many
note of given number in 2000,1000,500,200,100,50,20,10,5,2,1.
Ans :- Here's a Python program that takes a number as input and
calculates the number of each denomination of currency notes in it:
def count_notes(amount):
denominations = [2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1]
notes_count = {}
return notes_count
Output :-
7. Take three integer values from user and print lowest among them.
Ans :- Here's a simple Python program that takes three integer values
from the user and prints the lowest among them:
# Input: Get three integers from the user
num1 = int(input("Enter the first integer: "))
num2 = int(input("Enter the second integer: "))
num3 = int(input("Enter the third integer: "))