Programming in python |
|
Using inputs and outputs
Objectives
Challenge
- Understand how to program inputs and outputs in Python
Super Challenge
- Apply your understanding to your own game
Starter
In your book write down what outputs you think your text adventure game will need and what inputs your user will need to make.
GETTING STARTED
To start working in Python open up the program idle.
The easiest way to work is in Python editor - so go file new window and shut down the Python shell window that first opened
OUTPUT
To output a message in python you need to use the term PRINT
Try and get program Python to output a joke:
Press F5 to see it work
Need Help - look at page 17 in the Red Python Basics book
Objectives
Challenge
- Understand how to program inputs and outputs in Python
Super Challenge
- Apply your understanding to your own game
Starter
In your book write down what outputs you think your text adventure game will need and what inputs your user will need to make.
GETTING STARTED
To start working in Python open up the program idle.
The easiest way to work is in Python editor - so go file new window and shut down the Python shell window that first opened
OUTPUT
To output a message in python you need to use the term PRINT
Try and get program Python to output a joke:
- PRINT("It will need to look like this")
Press F5 to see it work
Need Help - look at page 17 in the Red Python Basics book
INPUTS
To get the user to input a choice you have to tell python they are inputting information. You also need to store what they input as a VARIABLE
NAME = INPUT("Please enter your name")
CHALLENGE
Try to write a program that lets you ask someone a question (gets an INPUT) and then OUTPUTS an answer
SUPER CHALLENGE
Get the program to use a VARIABLE in the output
Need Help - look at page 35 in the Red Python Basics book
To get the user to input a choice you have to tell python they are inputting information. You also need to store what they input as a VARIABLE
NAME = INPUT("Please enter your name")
CHALLENGE
Try to write a program that lets you ask someone a question (gets an INPUT) and then OUTPUTS an answer
SUPER CHALLENGE
Get the program to use a VARIABLE in the output
Need Help - look at page 35 in the Red Python Basics book