Python Python Basics Functions and Looping Create a Function

I'm stuck on this! Can someone help?

squaring.py
def repeat_twice(square)
return square * 2

2 Answers

Antonio De Rose
Antonio De Rose
20,856 Points

so many errors within python and there are few errors, where it would work in within python env, but not treehouse

1) when you declare a function, maker sure you mention the colon to end with: (python error) 2) after the function, where is the indentation, in the next line (python error) 3) treehouse question asks you declare a function in a specific name (not a python error) 4) the parameter too have been asked to be mentioned in a certain name (not a python error)

Owen Wherry
Owen Wherry
1,363 Points

You're doing great! To sum up what Antonio said,

  1. Make sure after you call your function (after square) you put a colon.
  2. Indent the body of your function, or line two of this code.
  3. Make sure your names of functions, variables, etc. match the names the challenge wants you to use. After doing these three steps, you should be on your way!