Question: For a given input series we need to represent a pattern in graph format.
As you can see in the image. The even digits are incrementing with “/” and odd digits are decrementing with “\” and at the highest point we get “That human figure”.
If the input value is 3 then it is taking 3 slashes. If it is in odd place it decreases with “\” 3 times , else it increments with “/” 3 times. Similarly the rest of the inputs.
Now I have written a code in which it is printing correctly but not side by side. It is printing from the next line.
My Code :
def descending(n):
for i in range(1,n+1):
for j in range(i+1):
if j==i :
print("\ ",end=" ")
else:
print(" ", end=" ")
print()
def ascending(n):
for i in range(n,0,-1):
for j in range(i+1):
if j==i :
print('/',end=" ")
else:
print(" ", end=" ")
print()
arr=[3,1,2,3,6,2]
for i in range(len(arr)):
if i%2==0:
ascending(arr[i])
print()
else:
descending(arr[i])
print()
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme