OneCompiler

Why it is showing an error?

#Find the cube and square of a number
a=float(input('Given number :',a)
S=aa
print("square of given number :",S)
C=aa*a
print("cube of the given number :",C)

STDIN
3

Output:

File "HelloWorld.py", line 3
S=a*a
^
SyntaxError: invalid syntax

2 Answers

4 years ago by

Hi, Could you post the OneCompiler code link? So that we can execute and see.

4 years ago by Karthik Divi

a=float(input('Given number :',a)
S=aa #check this line it shoud be aa
print("square of given number :",S)
C=aa
a
print("cube of the given number :",C)

4 years ago by Pankaj Kumar Pandey