Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Programming Assignment 2 , you are required to write a Python program that utilizes two functions. [ MO 2 . 5 ] The first

For Programming Assignment 2, you are required to write a Python program that utilizes two functions. [MO 2.5]
The first function would take a string and a number as parameters, and it would print the string preceded by as many spaces as specified by the number. Name the function as print_space.
The second function would take a string as a parameter and print it on three lines, with the string shifted to the right by a space on each consecutive line after the first line. Name the function as cascade_three.
Save your function definitions in a script file and also add the following statement at the very end of the file to execute it.
cascade_three(season)
which should output
season
season
season
Please note that the string season should be aligned to the very left on the first line.
Submit your program as a script file named COS-101_PA2_.py.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mysql Examples Explanations Explain Examples

Authors: Harry Baker ,Ray Yao

1st Edition

B0CQK9RN2J, 979-8872176237

More Books

Students also viewed these Databases questions

Question

=+7. What is its position?

Answered: 1 week ago

Question

explain the concept of strategy formulation

Answered: 1 week ago