Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

ethod

Answered: 1 week ago

Question

using signal flow graph

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago