Calvin (Deutschbein)
W2Fri: 5 Sep
import karel
def main():
move() |
# no import
def main():
move() # this won't work |
What does Python do?
some_karel.py
import karel
def main():
move() |
hello.pyprint("Hello, World!") |
Open chat (Ctrl+I), or select a language (Ctrl+K M), or fill with template to get started.
Start typing to dismiss or don't show this again.
print("hello world")
1234 * 5678 # its 7006652...
# but I would never be able to figure that out
2000 * 32 * 365
# CALvinORIES
print(2000 * 32 * 365)
C:\Users\me>python cal.py
23360000
<variable name> = <numerical value>
variable_name = 7 # one of my fav numbers
# CALvinORIES
calories_per_day = 2000
years = 32
days_per_year = 365
days = years * days_per_year
print(calories_per_day * days)
In the terminal...C:\Users\me>python cal.py
23360000
Does it happen more than once? | |||
No | Yes (it's a loop) | ||
Is it conditional (do we ask Karel a question)? |
No |
|
|
Yes |
|
|