Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 675 Bytes

File metadata and controls

29 lines (23 loc) · 675 Bytes

Do Now 4.03

Type in your console

    def print_6_stars():
    my_string = ''
    for i in range(0, 6):
        my_string += ' *'
    print(my_string)

In your notebook

  1. Write down what the output of the function print_6_stars is.
  2. Write a function print_star_square that calls print_6_stars in a loop to produce the following output.
    >>>python print_stars.py
    * * * * * *
    * * * * * *
    * * * * * *
    * * * * * *
    * * * * * *
    * * * * * *
  1. Rewrite the function print_star_square without using print_6_stars.
    • Note that there are two ways (at least) to get the above output, so just try doing both!