Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that takes as input a positive integer n and generates the following shape. 1 1 3 1 3 5 1 3 5

Write a program that takes as input a positive integer n and generates the following shape.

1

1 3

1 3 5

1 3 5 7

.

.

.

1 3 5 7 9 ...

2n-1 That is, row one contains the first positive odd integer 1, row two contains the first two odd integers 1 and 3, and in general, row i contains the first i odd integers 1, 3, , 2i 1, separated by spaces. If n = 6, the output should look like (note that every two consecutive rows are separated by an empty row):

1

1 3

1 3 5

1 3 5 7

1 3 5 7 9

1 3 5 7 911

Please do in simple python programming

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

6. Be able to choose and prepare a training site.

Answered: 1 week ago