R

@rohit_2p

marks.py

Python
3 years ago
phy= float(input("Enter Physics marks: ")) chem= float(input("\nEnter Chemistry marks: ")) math= float(input("\nEnter Maths marks: ")) bio= float(input("\nEnter Biology marks: ")) total= phy+chem+math+bio agg= (total/400)*100 if(agg>75): print("

piggybank.py

Python
3 years ago
"""WAP to calculate the total amount of money in the piggybank given the coins of Rs. 10, Rs. 5, Rs. 2 and Re. 1.""" def calculate_total(ten, five, two, one): total = ten * 10 + five * 5 + two * 2 + one * 1 return total ten = int(i

calci,py

Python
3 years ago
"""WAP to perform add, subtraction, multiplication, division on two integer number""" def perform_operations(a, b): print("Addition:", a + b) print("Subtraction:", a - b) print("Multiplication:", a * b) print("Division:", a /

two_points.py

Python
3 years ago
"""WAP to calculate the distance between two points.""" import math # input x1, y1 = map(float, input("Enter the x and y coordinates of the first point, separated by a space: ").split()) x2, y2 = map(float, input("Enter the x and y coordinat

variables.py

Python
3 years ago
"""WAP to read and print values of variables of different data types.""" # taking inputs string_value = input("Enter a string: ") integer_value = int(input("Enter an integer: ")) float_value = float(input("Enter a float: ")) # printing print("Strin

sqrt.py

Python
3 years ago
"""WAP to enter a no and display to hex and octal equivalent and its square root""" import math # enter a number num = int(input("Enter a number: ")) # convvert hex_num = hex(num) oct_num = oct(num)

vovel.py

Python
3 years ago
char = str(input("Enter the character: ")) if char[0] in ('a','e','i','o','u'): print("It's a vovel") else: print("not a vovel")

leap_year.py

Python
3 years ago
# WAP to check if year is leap year or not year = int(input("Enter the year: ")) if (year % 400 == 0) and (year % 100 == 0): print(f"{year} is a leap year") elif (year % 4 == 0) and (year % 100 != 0): print(f"{year} is a leap year") else:

temp.py

Python
3 years ago
# WAP to convert farenheit to celcius farenheit = int(input("Enter the temp in farenheit: ")) celcius = (5/9)*(farenheit - 32) print(celcius)

average.py

Python
3 years ago
# WAP to calculate average of two numbers num1 = int(input("Enter the first number: ")) num2 = int(input("Enter the second number: ")) average = (num1+num2)/2 print(f"\nAverage is: {average}")

ones_place.py

Python
3 years ago
# WAP to print the digit of ones place a = int(input('Please give me a number: ')) b = (a % 10) print(f"\nThe digit at once place is: {b}")

area_of_circle.py

Python
3 years ago
# area of circle radius = int(input("Enter the radius of a circle: ")) area = 3.14 * radius * radius print(f"\nThe area of circle is {area}")

trangle.py

Python
3 years ago
# WAP to calculate area of the trangle s1 = float(input("Enter the 1st side: ")) s2 = float(input("Enter the 2st side: ")) s3 = float(input("Enter the 3st side: ")) s = (s1 + s2 + s3)/2 area = (s *(s - s1) * (s - s2) * (s - s3)) * 0.5

main.py

Python
3 years ago
number = input("Enter the value of number: ") amount = input("Enter the amount: ") pi = input("Enter the value of pi: ") str = input("enter the code: ") population = input("Enter the population: ") str2 = input("Enter the message: ") print(f"Num: {