1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vedmedyk [2.9K]
3 years ago
10

3.17 (LAB) Ch 5 Warm up: Drawing a right triangle (Python 3) This program will output a right triangle based on user specified h

eight triangle_height and symbol triangle_char. (1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangle_char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle_height. The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangle_height. Output a space after each user-specified character, including a line's last user-specified character. (2 pts) Example output for triangle_char = % and triangle_height = 5: Enter a character: % Enter triangle height: 5 % % % % % % % % % % % % % % %
Computers and Technology
1 answer:
andre [41]3 years ago
3 0

Answer:

Find answers below

Explanation:

triangle_char = input('Enter a character: ')

triangle_height = int(input('Enter triangle height: '))

print('')

for j in range (triangle_height):

   print((triangle_char) * (j + 1))

#below are sample output that can be gotten with predefined values

$ ./triangles.py  

Enter characters: jk

Enter height: 8

j

jj

jjj

jjjj

jjjjj

jjjjjj

jjjjjjj

jjjjjjjj

k

kk

kkk

kkkk

kkkkk

kkkkkk

kkkkkkk

kkkkkkkk

You might be interested in
EASY QUESTION EASY POINTS!!!!! WILL MARK BRAINLIEST!!!!!
TEA [102]

The program is an illustration of loops and conditional statements

<h3>Loops</h3>

Loops are used to perform repetitive operations.

<h3>Conditional statement</h3>

Conditional statements are used to make decisions

<h3>The python program</h3>

The program in Python, where comments are used to explain each line is as follows.

#The following is repeated 5 times; i.e. the rows

for i in range(5):

   #The following is repeated 5 times; i.e. the columns

   for j in range(5):

       #For rows 2 and 5

       if i == 1 or i== 3:

           #For columns 1 and 5

           if j == 0 or j == 4:

               #This prints *

               print('*',end='')

           #For other columns

           else:

               #This prints an empty space

               print('',end=' ')

       #For other rows

       else:

           #This prints *

           print('*',end='')

   #This prints a new line

   print()

Read more about loops at:

brainly.com/question/19344465

5 0
3 years ago
Which of the following careers is part of the Printing Technology pathway?
torisob [31]
Textile designer i think

6 0
3 years ago
Why is the OSI reference model useful?
sveticcg [70]
The answer to this question is B.

3 0
3 years ago
Which of the following is one of the first two levels of formatting in a Word document?
Dafna1 [17]

Explanation:

Paragraph Formatting.

5 0
3 years ago
What is line-level?
Hunter-Best [27]

The maximum strength that an audio signal can be used is line-level.

A. The maximum strength that an audio signal can be.

<u>Explanation:</u>

Line level can be defined as a specified level indicating the strength of an audio signal which transmits analog sound between audio components such as CD players, DVD players, television sets and many more. Usually utilized Voltage and Audio Levels.

A line input level electrical sign ordinarily has a voltage running from 0,3 to 2 Volts, while a receiver level sign is all the more frequently in the range from 5 to 50 mV (millivolts). Most video editors concur that the general sound degree of your sound blend (the entirety of your sound consolidated) ought to be standardized between - 10db to - 20db.

3 0
3 years ago
Other questions:
  • Can you subnet the 172.16.128.0/17 network address to support this subnet?
    6·1 answer
  • 3 Points
    9·1 answer
  • How do you run a function in python?
    5·1 answer
  • Choose a firewall that is currently on the market and write a technical "sales pitch" to your classmates on why they should choo
    5·1 answer
  • The development of various technologies led to many historic events. Use information from the Internet to describe one major his
    7·1 answer
  • Give three reasons why you think Clip Art is so widely used in many different types of documents.
    13·2 answers
  • Help plzzzzzzzzzzzzzzzzzzzzzzzzz
    14·1 answer
  • Free coins who is octane and dont say u dont know because i will do the same to u
    13·2 answers
  • Mrs. Schlair has an annual salary of $96,402.<br> a. What would her semimonthly salary be?
    9·1 answer
  • Write a format operation that builds a string for the float variable amount that
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!