Changes

Jump to: navigation, search

OPS435 Python Lab 2

23 bytes removed, 13:04, 25 May 2017
INVESTIGATION 1: USER INPUT
run lab2a.py
</source>This Python script is not very useful: it displays the same output regardless of the number of times that the Python script is run.<br>The '''input()''' function is used to obtain information from the user and store it into a variable. It is recommended to place a question (or hint) as a argument in the input() function: this will aid the user in typing in the correct information.<br><br>
:#Return to your '''ipython3''' shell, edit the lab2a.py file and add type the following code: <source>
# Prompt user for colour to be stored into a variable called colour
colour = input("Type in a colour and press enter: ")
198
edits

Navigation menu