Finding volume and surface area of a cube


#1

so i ran into a problem with my code while doing an assignment. Can anyone help? thanks!

#3/1/18
#Purpose:to find the surface area of a cube using python
print("you are trying to find the surface area of a cube.")
print("you realize you would like to find the volume as well")
print("You use your knowledge of python to calculate the values")

from math import *

s=(input("Please enter the length of the cube.")
p = pow(s, 3)
print("the volume of the cube is " + str(p))

main()

#2
s=(input("Please enter the length of the cube.")

^, look at your parentheses. They do not match

here:

main()

you call the main function, but you don’t have a main function?

Personally, i would put import at the top, and only import what you need


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.