Week 1 - Functions, logic, conditionals discussion#
Goals#
Learn the basic constructs of Python programming
Create a program that plays a variant of Rock-Paper-Scissors
Functions#
Functions#
What is the advantage of functions?
Visualizing functions#
How can visualizing functions help us?
another visualizing tool: pythontutor.com
More operations#
What are the following libraries good for?
random
simplegui
math
What is the difference between
/
and//
?How can we model the wraparound of the spaceship in the game Asteroids
Logic and conditionals#
Logic and comparisons#
What is a Boolean variable?
Why are conditionals important in programming?
Is there an alternative logic to describe the truth (of an event)?
Conditionals#
Which control flow statements exist in Python?
Programming Tips - 1#
Mini-project #1 - Rock-paper-scissor-lizard-Spock#
The description states that the computer must choose its weapon randomly. How is player’s weapon chosen if we do not use any keyboard input in the game?
How did you implement the win/loss logic, in other words how do you decide if a weapon wins against another?