Question: Using python programming. Create a program that will output a counting box. The program should prompt the user for these inputs, in exactly this order:

Using python programming. Create a program that will output a counting box.

The program should prompt the user for these inputs,

in

exactly this order:

1.

The

width

of

the

box

2.

The

height

of the box

For these inputs, you can assume the following:

The height and

width will be integers greater than zero

Using this width and height, the program will print out a box where there are

width

numbers on each line and

height

rows. The numbers must count up

starting from 1, and should continue counting up (do

not

restart

the numbering).

HINT:

You can keep the

print()

function from printing on a new line by

using

end="

"

at the end:

print(

"Hello"

, end=

"

"

)

. If you do want

to print a new line, you can call print without an argument:

print()

.

You can put anything you want inside the quotation marks

a

bove

, we have

used a single space, to se

parate the numbers in the counting box. You can

also use an empty string, a comma, or

even whole words!

(See the next page fo

r sample output.)

CMSC 201

Computer Science I for Majors

Page

12

Here is some sample output for

hw3

_part

6

.py

, with the user input in

blue

.

(Yours does not have to match this word for word, but it should be similar.)

bash

-

4.1$ python hw3_part

6

.py

Please enter a width:

4

Please enter a height:

2

1 2

3 4

5 6 7 8

bash

-

4.1$ python hw3_part

6

.py

Please enter a width:

12

Please enter a height:

7

1 2 3 4 5 6 7 8 9 10 11 12

13 14 15 16 17 18 19 20 21 22 23 24

25 26 27 28 29 30 31 32 33 34 35 36

37 38 39 40 41 42 43 44 45 46 47 48

49 50 51 52 53 54 55 56 57

58 59 60

61 62 63 64 65 66 67 68 69 70 71 72

73 74 75 76 77 78 79 80 81 82 83 84

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!