Ask coding questions

← Back to all posts
how would I make this code more simple?
Kavin1983 (1)

I made a code finding the volume of a cylinder base * (pi(r squared) and I was wondering how I can make this more simple

Answered by 19ecal (228) [earned 5 cycles]
View Answer
19ecal (228)
def volume(): import math; return int(input("radius "))**2*math.pi*int(input("height "))

In one line
Is that simple enough