Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • About
  • Cards
  • Rate Tips
  • Tip Sheets

Misconception: Students think that “return x*x” changes the value of x to be x*x.

Share Misconception: Students think that “return x*x” changes the value of x to be x*x. with FacebookShare Misconception: Students think that “return x*x” changes the value of x to be x*x. with Twitter
Like(2516 Likes)
  • Students think that the mathematical function that executes on the return line results in a change to the variable's value that will be saved for later use.

More about this tip

Tags

  • Content Misconceptions
  • CS 1
  • Intro Programming
External Source

"Exploring programming misconceptions: an analysis of student mistakes in visual program simulation exercises" by Teemu Sirkiä and Juha Sorva.

Other Tips By
Other Tips By Juha Sorva
Juha Sorva

Similar tips

Explain recursion with the example of determining your row in a stadium by asking the row in front of your what row it is… asking until you get to the first row, the base case.
Misconception: Students get frustrated when they try to point their character to the left and it ends up flipped upside down because they don’t understand how changing the direction a sprite faces works in Scratch.
Have students use Python’s Turtle graphics to draw fractals using a Lindenmayer system, instead of recursion, to give students experience with string manipulation.
  • CSTT Facebook
  • CSTT Twitter

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Footer Icons by Mohammed Alyousfi. Powered by Drupal.

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College