PI = 3.14159 # Your functions - delete the comments/code inside them and write your code # Area of circle is PI times radius squared def areaOfCircle( radius ): # your code here :) # remember to return, not print, the value pass #delete this line # Circumference of circle is two times PI times radius def circOfCircle( radius ): # your code here :) # remember to return, not print, the value pass #delete this line # Ask user for input (remember to cast it to a float) # Call areaOfCircle with radius variable # Store the return value in a new variable called area # Call circOfCircle with radius variable # Store the return value in a new variable called circ # Use area value to print: Area of circle: whatever # Use circ value to print: Circumference of circle: whatever
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question