Computer Science, asked by ravikeerthana471, 11 months ago

write a program that reads in a number and prints out the letter T using '*' character with each line in the T having width n further the length of the horizontal bar should be 3n and that of the vertical bar 2n thus for n = 3 your program should print​

Answers

Answered by poojan
9

Language used: Python Programming

Program:

n=int(input())

#For the top horizontal line of T

for i in range(0,n):

   print('*'*(3*n))

#for the bottom vertical line in T

for i in range(0, 2*n):

   print(' '*n,end='')

   print('*'*n)

We have added an attachment of outputs for n=3, n=4, and n=5 too to make it more understanding about what's happening with the co de. Have a look.

Learn more:

1. Write a program to print the following pattern.

https://brainly.in/question/16895630

2. Write a program to display prime fibonacci numbers from 100 to 1000 in java

https://brainly.in/question/18378925

Attachments:
Similar questions