Guest User

Untitled

a guest
Aug 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. print("Question no. 21")
  2.  
  3. quest=str(input("Enter the question number"))
  4.  
  5. if quest=="a":
  6. b=int(input("Enter the value of b"))
  7. h=int(input("Enter the value of h"))
  8. print(1/3*(b**2*h))
  9. elif quest=="b":
  10. r=int(input("Enter the value of r"))
  11. h=int(input("Enter the value of h"))
  12. print(22/7*r**2*h)
  13. elif quest=="c":
  14. r=int(input("Enter the value of r "))
  15. h=int(input("Enter the value of h"))
  16. print(1/3*22/7*r**2*h)
  17. elif quest=="d":
  18. x1=int(input("Enter the value of x1"))
  19. x2 = int(input("Enter the value of x2"))
  20. y1=int(input("Enter the value of y1"))
  21. y2= int(input("Enter the value of y2"))
  22. print(((x2-x1)**2+(y2-y1)**2)**1/2)
  23. elif quest=="e":
  24. x=int(input("Enter the value of x"))
  25. h=int(input("Enter the value of h"))
  26. y=int(input("Enter the value of y"))
  27. k=int(input("Enter the value of k"))
  28. r=((x-h)**2+(y-k)**2)**1/2
  29. print(r)
  30.  
  31.  
  32. elif quest=="f":
  33. b=int(input("Enter the value of b"))
  34. a=int(input("Enter the value of a"))
  35. c=int(input("Enter the value of c"))
  36. x=(-b+(b**2-4*a*c)**1/2)/2*a
  37. print(x)
  38. elif quest=="g":
  39. a=int(input("Enter the value a"))
  40. n=int(input("Enter the value of n"))
  41. m=int(input("Enter the value of m"))
  42. d=m+n
  43. print(a**(d))
  44. elif quest=="h":
  45. a=int(input("Enter the value of a"))
  46. n=int(input("Enter the value of n"))
  47. m=int(input("Enter the value of m"))
  48. d=m*n
  49. print(a**d)
  50. elif quest=="i":
  51. a = int(input("Enter the value of a"))
  52. m = int(input("Enter the value of m"))
  53. n = int(input("Enter the value of n"))
  54. if m>n:
  55. print(a**(m-n))
  56. elif n>m:
  57. print(a**(n-m))
  58. elif quest=="j":
  59. a=int(input("Enter the value of a"))
  60. n=int(input("Enter the value of n"))
  61. d=1/a**n
  62.  
  63. else :
  64. exit("Wrong values were input")
Add Comment
Please, Sign In to add comment