Home python Please translate to python

Please translate to python




Something like this. The steps are as close to the original as possible:

r = "" # This line is essentially unnecessary
def sfera (r):
   sfera = float (4) * 3.14 * float (r) * float (r)
   return sfera
r = input ("Enter a number:")
print (sfera (r))

Answer 1

import math
r = input ("Enter radius:")
def sfera (r):
  sfera = float (4) * math.pi * float (r) * float (r)
  print (sfera)
sfera (r)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions