184_notes:python_syntax

This is an old revision of the document!


In this class, we are often going to use VPython to create computational models, which will serve as a powerful tool to help us create visualizations and apply the ideas in this course to more real-world contexts. Below are some of the common Python commands that we will use in this course and some coding tips compiled by previous EMP-Cubed students.

Note: we do not expect you to have any coding experience prior to this course, and we will not expect you to write a program from scratch. We will primarily be asking you to interpret chunks of code with your group members and adjust/modify pieces of code that you will be given.

  • Exponents **
  • Objects (box, sphere, arrow)
    • Object characteristics (pos, length, width, radius, color, etc)
  • Vectors - vec()
  • Magnitude - mag()
  • Print - print()
  • Dot Product - dot()
  • Cross Product - cross()
  • Watch parentheses
  • Watch upper/lower cases
  • Watch whitespace
  • Comments
  • 184_notes/python_syntax.1527174753.txt.gz
  • Last modified: 2018/05/24 15:12
  • by dmcpadden