Learning Journal Unit 2 CS 1101.docx - Learning Journal Unit 2 Part 1 The volume of a sphere is 4\/3\u03c0r3 where \u03c0 has the value of\"pi given in Section

# Learning Journal Unit 2 CS 1101.docx - Learning Journal...

• 4
• 83% (6) 5 out of 6 people found this document helpful

This preview shows page 1 - 4 out of 4 pages.

#### 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

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern