0% found this document useful (0 votes)
2 views

program shashwat

The document contains a series of Python code snippets that perform various calculations, including product, area, volume, and number checks. It also includes multiple-choice questions (MCQs) and predictions about potential errors in the code. Overall, it serves as a programming exercise focusing on basic arithmetic operations and control structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

program shashwat

The document contains a series of Python code snippets that perform various calculations, including product, area, volume, and number checks. It also includes multiple-choice questions (MCQs) and predictions about potential errors in the code. Overall, it serves as a programming exercise focusing on basic arithmetic operations and control structures.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1)a=3

b=4
c=5
print("the product is:","",a*b*c)

2)a=int(input("enter a number"))
b=int(input("enter a number"))
c=int(input("enter a number"))
print("the product is","",a*b*c)

3)a=float(input("enter the temperature in celcius"))


print("the temperature in fahrenheit is","",((a*1.8)+32))

4)a=float(input("enter the base of triangle"))


b=float(input("enter the height of the triangle"))
print("the area of triangle is",((a*b)/2))

5)a=float(input("enter the number of which you want the square root"))


print("the square root is","",a**0.5)

6)a=float(input("a's value"))
b=float(input("b's value"))
c=0
c=a
a=b
b=c
print("a is:",a)
print("b is :",b)

7)a=int(input("enter the number of article purchased"))


b=float(input("enter the price of 1 article"))
c=float(input("enter the discount percent given"))
d=a*b
print("the net amount is",(d-((d*c)/100)))

8)a=float(input("enter the radius"))


b=a**2
print("the area of the circle is",((22*b)/7))

9)h=float(input("enter the height of cylinder"))


r=float(input("enter the radius of cylinder"))
pi=22/7
volume=pi*r*r*h
suracea=(2*pi*r*r)+(2*pi*r*h)
print("the volume of the cylinder is","",volume)
print("the surface area of cylinder is","",suracea)

10)a=int(input("enter a number"))
if a%2==0:
print("the number is even")
else:
print("the number is odd")

11)a=int(input("enter the number"))


b=int(input("enter 2nd number"))
c=int(input("enter the third number"))
if a>b and a>c:
print("the greatest number",a)
elif b>a and b>c:
print(" the greatest number",b)
elif c>a and c>b:
print(" the greatest number",c)

12)for i in range(1,11):
print(7,"*",i,"=",7*i)

13)n = int(input("Enter a number: "))


sum_of_series = n * (n + 1) // 2
print("The sum of the series 1 + 2 + 3 + ... +", n, "is:", sum_of_series)

14)n = int(input("Enter the range of number: "))


sum = 0
i = 1
while i <= n:
sum += i
i += 2
print("The sum of the series =", sum)

15)n = int(input("Enter the range of number: "))


sum = 0
for i in range(1, n + 1):
sum += i * i
print("The sum of the series =", sum)

16)n = int(input("Enter the range of number: "))

sum = 0

for i in range(1, n + 1):


sum += i ** i

print("The sum of the series =", sum)

17)n = int(input("Enter the range of number: "))

sum = 0

for i in range(1, n + 1):


sum += 1 / i

print("The sum of the series =", sum)


MCQ:
1)a)5 4
2)b)f=100.4
3)a)Sum of 15 and 12 is 27
4)c)simple interest is 0.01
5)a)Sachin Tendulkar
6)c)TypeError: unsupported operand
7)d)Syntax error
8)d) Error
9)d)<class'str'>
10)c)3
PREDICT:
1)error because no bracket for the print statement
2)error for the same reason
3)error for the same reason
4)error for the same reason

You might also like