apcs-bpc
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apcs-bpc [2023/09/15 05:50] – created appledog | apcs-bpc [2023/09/15 05:58] (current) – appledog | ||
---|---|---|---|
Line 7: | Line 7: | ||
Write a program that asks for your name, and then prints " | Write a program that asks for your name, and then prints " | ||
- | === Step One: print() | + | === Step One: Basic Output |
- | < | + | In python, the basic output is print(). |
+ | |||
+ | < | ||
print(" | print(" | ||
Line 14: | Line 16: | ||
</ | </ | ||
- | Now I explain what this does and add; | + | This allows you to print messages to the console. |
- | < | + | Now lets explore what a variable is. |
+ | |||
+ | < | ||
name = " | name = " | ||
print(" | print(" | ||
+ | |||
</ | </ | ||
- | So the key is we need to add the name: | + | Here we store some information and use it later. We store the name " |
- | < | + | === Step Two: Basic Input |
+ | |||
+ | < | ||
name = input(" | name = input(" | ||
print(" | print(" | ||
+ | |||
</ | </ | ||
- | This is the final version of the instruction program. Now we ask Roger to write a new program: | + | This is the final version of the instruction program. Now we ask the students |
- | This is the program he wrote: | + | === Problem 1 |
+ | Problem 1: Input your first name and last name, and write "Hello < | ||
- | < | + | ==== Answer |
+ | |||
+ | < | ||
a = input(" | a = input(" | ||
- | c = input(" | + | b = input(" |
print(" | print(" | ||
+ | |||
</ | </ | ||
Mark: 100% | Mark: 100% | ||
- | Comment: | + | Comment: |
apcs-bpc.1694757026.txt.gz · Last modified: 2023/09/15 05:50 by appledog