New to coding


I am currently going through the codecademy course learning python. I am not trying to solve a problem, just some info. My current problem is:

def square(n):
  """Returns the square of a number."""
  squared = n ** 2
  print "%d squared is %d." % (n, squared)
  return squared
# Call the square function on line 10! Make sure to
# include the number 10 between the parentheses.


My question is, on the print line, the “%” are followed by a “d”. In earlier problems i have seen them with “s” and even ": \ ". I am wondering if there is a site or document that can tell me what all these are used for and when im supposed to use each one.



If programming was about remembering syntax, computers would have been programming long time ago. But humans are still there, so clearly its not all about remembering.

well, python has official docs:

but usually you are faster off googling something. Google and stackoverflow are you friend, learn how to use them :slight_smile:


ive been using that


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