- Explain input and f-string.
- Apply today's ideas in a small Python program.
- Inspect output and improve the program after a test run.
- input
- f-string
- conversion
- output design
Interactive programs collect text with input. Convert numeric answers carefully and use f-strings to make outputs readable. Explain what information is required before asking for it.
Before coding, describe the input, processing, and output in ordinary language. Run the smallest possible version, then extend it one change at a time. Read the error message before asking for help.
name = input('Name: ')
city = input('City: ')
print(f'{name} is building from {city}.')Add age and an interest to the profile script.
Validate that age can be converted before calculating next-year age.
Build the required personal profile feature.
A labelled profile summary is displayed.
Finish the personal information programme and commit it.
- Official Python documentation
- Week resources
- Relevant retained examples in the repository, where referenced above