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
Natasha2012 [34]
3 years ago
13

Write a program that prints the block letter “B” in a 7x7 grid of stars like this:

Computers and Technology
1 answer:
makkiz [27]3 years ago
6 0

Answer:

  1. output = ""
  2. for i in range(7):
  3.    if(i % 3 == 0):
  4.        for i in range(5):
  5.            output+= "*"
  6.        output += "\n"
  7.    else:
  8.        for i in range(2):
  9.            output += "* "
  10.        output += "\n"
  11. print(output)

Explanation:

The solution code is written in Python 3.

Firstly, create a output variable that holds an empty string (Line 1).

Create an outer loop that will loop over 7 times to print seven rows of stars (Line 2). In row 0, 3 and 6 (which are divisible by 3) will accumulate up to 5 stars using an inner loop (Line 4-5) whereas the rest of the row will only print two stars with each start followed by a single space (Line 8-9) using another inner loop.

At last, print the output (Line 12).  

You might be interested in
24/3*2^2/2*3+(20-10)-40
ycow [4]

Answer:

34

Explanation:

You use pemdas

8 0
2 years ago
Where does the CPU store its computations
mario62 [17]

Answer:

In main memory

Explanation:

Hope this helps

8 0
3 years ago
Read 2 more answers
You are driving in the right lane of a municipal road the road has three lanes in your direction ahead of you in the lane to you
Mrrafil [7]
Pull Over. Do NOT Try to push the brake or try swerving with the steering wheel. Slowly pull to the side
7 0
3 years ago
Read 2 more answers
A(n) _____ is similar to a virus, except that it is an independent program that can be spread across computer networks without b
CaHeK987 [17]
The term you're looking for is worm
5 0
3 years ago
Which of the following actions should you take when turning left at an intersection?
fomenos
The answer is B Okay good luck and dont...mess it up
8 0
3 years ago
Other questions:
  • Tanya has received an email, apparently from her bank, stating that some of her records were lost during server maintenance work
    13·2 answers
  • Assume the existence of a Bank Account class. Define a subclass, Savings Account that contains the following: a double instance
    5·1 answer
  • Run the browser checker to see that the computer you are using now is set up for WileyPLUS. Which of the following browser funct
    15·1 answer
  • Explain what is meant by information technology (IT). Explain what is meant by information systems (IS). Why is it important to
    7·1 answer
  • How would you describe the relationship between blocks of code and commands?<br>HELP​
    10·1 answer
  • Quick!!!!!
    13·2 answers
  • Which letter would appear in the third position of the standard wheel marking of a hard-grade wheel?
    10·2 answers
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    5·2 answers
  • Explain the term information security?​
    9·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!