Question: Q 4 ) Define a function, make _ hills, that takes a file path and a list of integers and writes a *

Q4) Define a function, make_hills, that takes a file path and a list of integers and
writes a "*" that many times on a line for each number in the list. Calling this function
multiple times should add more lines to the end of the file. Ignore any numbers that
are negative.
Hint: You can create a duplicated string using the multiplication operator; for example
"test"*3 would result in "testtesttest".
Ex: Input: "hills.txt",5,-1,3
File Before:
File After:
 Q4) Define a function, make_hills, that takes a file path and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!