Common Computer Science References
At the end of this lesson, you will be able to:
understand and use an if statement
sequential programming
go over Boolean Expressions , Computer Based Problem Solving
go over If…Then , Computer Based Problem Solving
watch this video
the video presenter has BAD programming habits
"=" this is not an "equal" sign it is an "assignment statement"
"==" is an "equal" operation
now if __name__ == "__main__" should makes more sense:
step through the "Too Many Students" program (see below)
notice it will only seem to do anything if the number is over 30, we will fix this later
create the "Number Guessing Game" program
save the number in a constant
hint: my number is "5"
ask the user to enter a number (between 0 and 9)
tell them when they get it right, if they did
tell them when they get it wrong, if they did
you will need 2 separate if statement to be able to do this
unsure you use 2 if statements (one for right a second for wrong)
if you know about if ... Else, DO NOT USE IT, yet!
recreate the same above program in another language
NOTE: You can turn on "Closed Captions" to see a printout of what is being said by selecting the "CC" button.
You can also have it translate the closed captions by going to "Settings, Subtitles/CC, Auto-translate" and then pick your prefered language.
NOTE: You can turn on "Closed Captions" to see a printout of what is being said by selecting the "CC" button.
You can also have it translate the closed captions by going to "Settings, Subtitles/CC, Auto-translate" and then pick your prefered language.