CS 110 Lecture 2: CS 110 Lesson 2 notes
Document Summary
9/1/16 import os os. system("clear") to clear the terminal screen on mac and linux os. system("cls") for windows. Variable syntax: myvarisgreat - camel case, used generally for java my_var_is_great - snake case, used for python* *any case can be used for python, as long as it is consistent (don"t switch from camel case to snake case within the same piece of code) Combining two or more values to make a new value: x + y*5. Assigning something to a variable: z = x +y. If the string has anything other than a number, it will produce an error. Algorithms are like a recipe for a computer. A valid outcome comes when all of the steps are implemented properly. Classwork examples (note that this isn"t the complete classwork, because the professor doesn"t put the classwork up: calculate the expressions below: 10//15 : use parentheses to make the expression equal 78.