Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Misconception: Students think that both the IF and the ELSE cases of a conditional are executed every single time a conditional runs.

  • For example, here is a conditional in Python:
      if ( x<2 ):
        print "This is fun."

      else:

        print "I love CS."

  • Students sometimes think that if x=1, the computer will print "This is fun." then continue to ELSE and print "I love CS."

More about this tip

Tags

  • Content Misconceptions
  • Python
  • Intro Programming
  • CS 1
  • Programming Concepts
External Source

"Visual program simulation in introductory programming education" by Juha Sorva.

Other Tips By
Other Tips By Juha Sorva

Similar tips

Discuss and explore the difference between additive (sequential) and multiplicative (nested) loop structures to give students practice reasoning about loops.
Misconception: Students who are familiar with writing code in block-based languages like Scratch still need support transitioning to text-based languages like Java.
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.

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

Privacy Policy