Module 4 Worksheet 6: Star Loops
For each of the outputs shown below, write a Python function definition that has one parameter which is an integer representing the number of lines of output. In all the example outputs, the parameter is the value four, but it could be any other non-negative integer.
For the first output, write two versions of your function definition:
1. Version 1: Have the function definition print the output to the console.
2. Version 2: Have the function definition build up a string that it returns and that is then printed by the global code.
For the remaining functions that you write, have the function return a string containing the output, which is then printed by the global code.
For each function, show a call from the global code to that function. If the function you call returns a string, the global code needs to print that string on the console.
1. Each line has the line number of stars.
*.**
2. ***
3. **
4. ****
5. ..