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
Refer to the color wheel to identify the color scheme.
morpeh [17]
C) monochromatic
Hope this helps!

btw make me brainliest?
4 0
3 years ago
The roll out, roll in variant of swapping is used ____."
Sindrei [870]

Answer:

C.) for priority-based scheduling algorithms

Explanation:

for priority-based scheduling algorithms

4 0
2 years ago
Type the correct answer in the box. Spell all words correctly. Joseph is a digital media developer and has years of work experie
Damm [24]

It is better to develop soft skills. Irrespective of profession, soft skill is a common skill which is required to be present in everyone to move along with others and continue the work successfully. A person who is good at technical need soft skill to work in collaboration with others, manage team, solve problems, etc.

So there are separate soft skill training provided for various roles and years of experience. So, I suggest to have soft skill training and do additionally MBA degree.

5 0
3 years ago
You are given a list of n positive integers a1, a2, . . . an and a positive integer t. Use dynamic programming to design an algo
Anna11 [10]

Answer:

See explaination for the program code

Explanation:

The code below

Pseudo-code:

//each item ai is used at most once

isSubsetSum(A[],n,t)//takes array of items of size n, and sum t

{

boolean subset[n+1][t+1];//creating a boolean mtraix

for i=1 to n+1

subset[i][1] = true; //initially setting all first column values as true

for i = 2 to t+1

subset[1][i] = false; //initialy setting all first row values as false

for i=2 to n

{

for j=2 to t

{

if(j<A[i-1])

subset[i][j] = subset[i-1][j];

if (j >= A[i-1])

subset[i][j] = subset[i-1][j] ||

subset[i - 1][j-set[i-1]];

}

}

//returns true if there is a subset with given sum t

//other wise returns false

return subset[n][t];

}

Recurrence relation:

T(n) =T(n-1)+ t//here t is runtime of inner loop, and innner loop will run n times

T(1)=1

solving recurrence:

T(n)=T(n-1)+t

T(n)=T(n-2)+t+t

T(n)=T(n-2)+2t

T(n)=T(n-3)+3t

,,

,

T(n)=T(n-n-1)+(n-1)t

T(n)=T(1)+(n-1)t

T(n)=1+(n-1)t = O(nt)

//so complexity is :O(nt)//where n is number of element, t is given sum

6 0
2 years ago
Wite 3 names of computers used in 1st generation of computers?
enyata [817]
Here are some of the computers used in the first generation of computers:
ENIAC
EDVAC
UNIVAC
IBM-701
IBM-650
These are some of the first computers ever that led to today's computers.
5 0
2 years ago
Other questions:
  • Enter a formula in cell b7 to calculate the average value of cells b2:b6
    13·1 answer
  • Computer-based networks that trigger actions by sensing changes in the real or digital world are known as: global marketing plat
    6·1 answer
  • Brainly wont show me the "I'm Done" button after an interactive ad, and I cant figure out why. I've watched the entire ad, click
    11·2 answers
  • Write a Java program that prompts the user for an int n. You can assume that 1 ≤ n ≤ 9. Your program should use embedded for loo
    5·1 answer
  • Solve(-8/3)+7/5 please answer​
    5·1 answer
  • To extract detailed and comprehensive responses from your client, use the _____ questioning technique.
    5·2 answers
  • Write a SELECT statement that returns one row for each musician that has orders with these columns:
    13·1 answer
  • What is operating system​
    10·2 answers
  • State whether the given HTML coding is True or False. &lt;HR SIZE=5 COLOR=YELLOW ALIGN=RIGHT WIDTH=75%&gt;​
    9·1 answer
  • Tom wants to find a number so that the sum of the digits of a two-digit number is 7. When reversing the digits, the number shoul
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!