#### You've reached the end of your free preview.

Want to read all 4 pages?

**Unformatted text preview: **Part 1 >>> import math >>> print(math.pi) 3.141592653589793 >>> def print_volume(): print ("What is the radius of the sphere? Please input:") r=float(input()) V=4/(3*math.pi*(r**3)) print (V) >>> print_volume() What is the radius of the sphere? Please input: 0.5 3.3953054526271007 >>> print_volume() What is the radius of the sphere? Please input: 15 0.00012575205380100372 >>> print_volume() What is the radius of the sphere? Please input: 5 0.0033953054526271007 >>> Part 2 >>> def invented_function(): print("a=") a=str(input()) print("b=") b=str(input()) print ("a+b="+a+b) print("x=") x=float(input()) print("y=") y =float(input()) print("x/y=") z=x/y print (z) >>> invented_function() a= 7 b= 3 a+b=73 x= 1 y= 10 x/y= 0.1 >>> invented_function() a= Greatest b= Ever a+b=GreatestEver x= 18 y= 6 x/y= 3.0 >>> invented_function() a= Tom b= Bardy a+b= Tom Brady x= 6 y= 6 x+y= 12.0 >>>...

View
Full Document

- Spring '18
- Jane