118k views
0 votes
Hi I need help, This assignment is for Assignment 6 Question 4 in edhesive for computer science. here is the prompt:

Assignment 6: Question 4


Instructions

Assignment 6: Code Snippet

Use the code snippet provided below as the basis for your work on each question in Assignment 6. Note that you may need more than two for loops for shapes in some of the questions.

for i in range(3):
for j in range(3-i):
print("*", end=" ")
print("")

Question 4 Instructions

Use the code snippet above to write a program that uses looping to output the following shape:

FOURTH

* * * * * * * * * *
* * * * * * * * *
* * * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*

Please help I don't understand what I m doing wrong and I cant find help anywhere(Also I am in highschool not middle school if that helps anyone)

1 Answer

2 votes

Answer:

Following are the python code to print the given pattern:

print('FOURTH') # using print method

for i in range(10): #using loop to count numbers

for j in range(10-i): # use loop to print asterisk value in reverse order

print("*", end=" ") #print value

print("") #using print method for space

Output:

Please find the attachment.

Step-by-step explanation:

The description of the above python program can be described as follows:

  • In the first line, use the print method, that print message "FOURTH".
  • In the next line, two for loop is used in which the first loop counts the number to be print value, inside the loop another for loop is used.
  • In this loop, it prints asterisk values in its reverse order and for new lines, it will use the print method with a single white space.
Hi I need help, This assignment is for Assignment 6 Question 4 in edhesive for computer-example-1
User Che
by
5.7k points