You are on page 1of 3

Q1)pi=3.

14

radius= oat(input("enter the radius of the circle"))

area= pi * radius * radius

print("radius =",radius)

print("Area = ", area)

Q2)Num1=int(input(“enter the value of Num1: "))

Num2=int(input("enter the value of Num2: "))

Product=Num1*Num2

print("The product of two numbers are :",Product)

Q3)Amount=int(input(“Enter the amount: "))

Discount=10/100

Discounted_Amount=Amount-Discount*Amount

print("The Final price after discount is: ",Discounted_Amount)

Q4)print(“Enter the marks of ve subjects::")

subject_1 = oat (input ())

subject_2 = oat (input ())

subject_3 = oat (input ())

subject_4 = oat (input ())

subject_5 = oat (input ())

total, average, percentage, grade = None, None, None, None

# It will calculate the Total, Average and Percentage

total = subject_1 + subject_2 + subject_3 + subject_4 + subject_5

percentage = (total / 500.0) * 100

print ("\nThe Total marks is: \t", total, "/ 500.00")

print ("\nThe Percentage is: \t", percentage, "%")

Q5)print("Enter Length of Rectangle: ")

l = int(input())

print("Enter Breadth of Rectangle: ")

b = int(input())

p = 2*(l+b)

print("\nPerimeter = ", p)

fl
fl
fl
fl
fl
fl
fi
Q6)print("Enter the Values for Variable: \n")

variableOne = input()

variableTwo = input()

print("\nBefore Swap:")

print("Value of \"variableOne\" =", variableOne)

print("Value of \"variableTwo\" =", variableTwo)

x = variableOne

variableOne = variableTwo

variableTwo = x

print("\nAfter Swap:")

print("Value of \"variableOne\" =", variableOne)

print("Value of \"variableTwo\" =", variableTwo)

Q7)print("Enter Two Numbers: ")

numOne = int(input())
numTwo = int(input())

if numOne>numTwo:
print("\nLargest Number =", numOne)
else:
print("\nLargest Number =", numTwo)

Q8)print("Enter the Number: ")

num = int(input())

if num<0:
print("\nNegative Number")
elif num==0:
print("\nZero")
else:
print("\nPositive Number")

Q9)print("Enter the Number: ")

num = int(input())

if((num % 5 == 0) and (num % 11 == 0)):

print("\n Divisible ")

else:

print("\n Not Divisible by 5 and 11")

Q10)

print("Enter the year")

num=int(input())

if (num%4==0):

print("The year is leap year")

else:

print("The year is not a leap year")

Q11)

def fun(str):

vowel = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']

if str == vowel:

print("It is a vowel")

else:

print("It is a consonant")

fun('a')

fun('o')

You might also like