Question: Computer Programming PROBLEM 2 In this problem, you are given a partially completed program, and you need to update and fill in the rest of
Computer Programming PROBLEM
In this problem, you are given a partially completed program, and you need to update and fill in the rest of the program to produce the desired output.
This program should ask the user to enter a number of rows and a number of columns. The program will then print a pattern based on the user's input. The pattern follows these rules:
If the row is even numbered ndth etc. and the column is even numbered, then the character in that spot will be a blank or space character.
Otherwise, the character in that spot will be an asterisk:
Sample output :
How many rows?
How many columns?
Sample output :
How many rows?
How many columns?
HINT: Be careful about how the numbers work in your program. Often times a program may be counting numbers starting with when a user may be counting from
HINT: When determining if a number is even or odd, the modulus or remainder operator can be very helpful.
The instructor has provided a file called LabPFillThisIn.py Download that file and rename it LabPpy
Copy that file into your PyCharm project.
Change the program header to include your name and the date.
ONLY replace every instance of Fill this in with correct code that will enable the program to generate the patterns shown above.
Run this program using the PyCharm Terminal.
Take a screenshot of the Terminal that includes the line showing where you started the program run with the results.
Name the screenshot LabPouput.jpg#
# Student Name
# Date
# Pretty Pattern Generator
#
# NOTE: With the range functions, you may use
# one, two, or three parameters to accomplish
# your task.
FillThisIn None # Replace FillThisIn with correct code below
# Ask the user for the number of rows
numrows FillThisIn
# Ask the user for the number of columns
numcolumns FillThisIn
# Iterate over the rows.
for row in rangeFillThisIn:
# Iterate over the columns.
for col in rangeFillThisIn:
# Test if the row and column are even numbered
if Fillthisin and FillthisIn:
print end
else:
print end
# Go to the next row.
print
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
