Variables and Data types
Create your own Program
Set your Learning Objectives to red.
Open your PowerPoint from last lesson.
If you need to download a copy of thePowerPoint Click here and open Task 1.
Copy this "Input Cheat sheet" into your PowerPoint.
In python if you want the user to input data into the program, you can use the input()function, this is another built in functions to help us put data into our program.
Let us now look at the the input method input().
Let's start with a simple input and create it in python.
Copy the code above into your python window.
Save the file name as input.
Run the code.
You should see this
In your Powerpoint put a screenshot of your code with an explanation of what it does.
...In order to get user input in python you need to use the input() function. This puts a prompt onto the screen to allow the user to enter data. If you want to use the data in your program you have to store it in a variable . The print function can then use the variable to output our user input to the screen .
Let's try another simple input and create it in python.
Save the file name as 'input2'.
In your Powerpoint put a screenshot of your code.
Overall objective: In this task, you will use your knowledge of Python's input, print, and variables to create an exciting introduction for a text adventure game using Thonny. You will also save your Python file onto your OneDrive school account as "MyTextAdventure.py."
Objective: In this task, you will initially focus on using your creative writing skills to craft a captivating introduction for a text adventure game. Once you've completed the introduction, you can further extend the task by incorporating variables and input to create an interactive text adventure game.
You stand at the edge of a dense, ancient forest, its towering trees shrouded in mist that dances in the pale moonlight. The air is thick with the earthy scent of moss and the distant murmur of a hidden stream. Before you lies a forgotten path, overgrown with ivy and covered in fallen leaves, disappearing into the heart of the woods. It beckons you with an eerie allure, promising secrets and treasures untold. But be warned, brave adventurer, for this forest holds mysteries of both wonder and peril. Will you:
Tips:
Once you've completed both parts of this task, you will have crafted a captivating introduction and created an interactive text adventure game, showcasing your creative writing skills and your ability to use variables and input in Python.