Task 1
The following is the result from the code I wrote in the getting started.py
file, followed by the file itself:
7.1: getting
# Initial
print("Message 1")
print("Message 2")
# Extension
print("Message 1\nMessage 2")
# Extension Extension
print("""Message 1
Message 2""")
Output
>>> Message 1
>>> Message 2
>>> Message 1
>>> Message 2
>>> Message 1
>>> Message 2
Task 2
This was the second task.
I had an issue here with the way I am compiling the python source at build time, as it does not support stdin
and stdout
as arguments.
Because of this I had to hardcode the responses, but lets just pretend that I didn't do that, and you typed in your responses
7.2: names.py
# Note I had to hardcode in the responses because the way I ran the Python code at build time did not work well with inputs.
first_name = "Damien"
middle_initial = "M"
last_name = "Atkinson-Buck"
print("Enter your first name: " + first_name)
print("Enter your middle initial: " + middle_initial)
print("Enter your last name: " + last_name)
print(
f"Your full name is {first_name} {middle_initial} {last_name}, is that correct?")
Output
>>> Enter your first name: Damien
>>> Enter your middle initial: M
>>> Enter your last name: Atkinson-Buck
>>> Your full name is Damien M Atkinson-Buck, is that correct?