Q. Write a program that uses exactly four for loops to print the sequence of letters below.
AAAAAAAAAABBBBBBBCCCCCCEEEEE
Answer =
for i in range (1, 5) : print ("A" * i , end = "") for i in range (3, 5) : print ("B" * i , end = "") for i in range (1, 4) : print ("C" * i , end = "") for i in range (2, 4) : print ("E" * i , end = "")
could u tell me the answer
ReplyDeletefor this question
'Write a program that uses a for loop to print the numbers 100, 98, 96, . . . , 4, 2.'
for i in range (100, 1,-2) :
Deleteprint( i , end = " , ")
2. Write a program to fill the screen horizontally and vertically with your name. [Hint: add the option end='' into the print function to fill the screen horizontally.]
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )