# IntVariable.py # demo an int variable storing a value and varying its value. # to "understand the quintessence of programming." # Programs process data. # All data in all programs in all the world is stored in variables. # E.g. everything you type, click, swipe, say, see, be at, go, feel. # Everything you read, see, hear at every website and app. # Everything in every corporate and government database. # create a variable and assign 12 to be its value: students = 12 #think of a variable as a little box in the computer but it's actually # a named location in memory (RAM). #its name is students. #it can store/hold one value, which now is the integer 12. #names of variables can consist of letters, digits and _ but # cannot start with a digit. name should be meaningful, # indicating what the variable is used for, what its purpose is. # = is the "assignment" "operator". #it is an action, not an equation. leftside must be a variable, #rightside an expression. rightside is evaluated, then that (single) #value is assigned to be the value of the leftside variable. print("variable is now: ", students) students = students + 1 #add one to the students variable. #assign its current's value plus one as its new value. #rightside is students+1 students is 12, so it's 12+1 which is 13, #so 13 is assigned to leftside variable print("and now it's: ", students) #Variables is a fundamental notion in programming. # Another fundamental notion: #You are specifying a sequence of commands, directives, or "statements" that the computer is to do. # Essentially this Python environment is the computer. It's a machine that understands Python. # You are creating the activity that happens.