Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help, My code needs to look like this picture right now my code is only printing the top half of it . I've

I need help, My code needs to look like this picture right now my code is only printing the top half of it. I've posted it below. # Part 3
# Get user input for n
n = int(input("Enter a positive integer (n): "))
# Print the pattern
for i in range(n,0,-1):
# Print decreasing sequence
for j in range(1, i +1):
print(2* j -1, end="")
# Print spaces
for _ in range(2*(n - i)):
print("", end="")
# Print increasing sequence
for j in range(i,0,-1):
print(2* j -1, end="")
# Move to the next line after each row
print()
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

What is the principle of thermodynamics? Explain with examples

Answered: 1 week ago