Title: Simple demo questions
Course: Backup and restore test course

A function that prints

A common problem for students learning Python is the distinction between functions that return a value ("true" functions) and functions that print output and (preferably) don't return a value ("procedures"). This is an example of the latter.

Write a Python3 function print_sqrs_1_to_n(n) that takes a single positive integer as a parameter and prints a table of all integers and their squares from 1 up to and including n, formatted as below. The output from your function, when called with the code in the Test column, should be exactly as shown in the Result column.

The penalty regime for this question is 5, 15, 25, ... i.e., there is a 5% penalty for the first wrong submission but the penalty thereafter rises by 10% for each wrong submission.

Write a Python3 program that repeatedly uses the input() function without a prompt string to read a person's name from standard input and prints a corresponding welcome message until the input line is the string bye, at which point the program exits. The test for bye should be case-insensitive. The welcome message depends only on the first name and whether or not that first name is Richard (case insensitively) as shown in the example table below. The first name is defined to be all text up to but not including the first space or the entire line if no space is present in the line. You may assume the line bye is always present in the input.