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
Ray Of Light [21]
3 years ago
15

Python 3.12 LAB: Input and formatted output: Right-facing arrow Given input characters for an arrowhead and arrow body, print a

right-facing arrow. Ex: If the input is: * # Then the output is: # ******## ******### ******## #
Computers and Technology
1 answer:
Sloan [31]3 years ago
3 0

The code below prints the required shape using the string manipulations in Python.

In Python, if we multiply a character with a number, we get that character side by side that number of times.

For example: 6 * '#' would give us → ######

Also, we can use + sign to concatenate the strings.

For example: 'hi' + ' there' would give us → hi there

We use this approaches to print the required shape line by line.

Comments are used to explain each line.

The output is attached as an image.

#get the characters from the user

base_char = input()

head_char = input()

#set first row with 6 spaces and 1 head_char

row1 = 6 * ' ' + head_char

#set second row with 6 base_chars and 2 head_chars

row2 = 6 * base_char + 2 * head_char

#set third row with row2 and 1 head_char

row3 = row2 + head_char

#print the rows to draw the shape

print(row1)

print(row2)

print(row3)

print(row2)

print(row1)

You may see another question at:

brainly.com/question/22101725

You might be interested in
Why does a print document need a higher raster effect setting ?​
mario62 [17]

Answer:

gives label artwork a professional, polished look.

Explanation:

6 0
3 years ago
What term is used to describe an individual's money and personal property? budget income assets finances
Ilya [14]

Answer:

Pretty sure it's assests.

Explanation:

Income - Intake of money.

Budget - How much money you can spend.

Finances - Things you need to pay ort fund.

3 0
3 years ago
Read 2 more answers
What was your first experience with listening to kpop?
Verizon [17]

Answer:

My first experience with kpop was when I was six I just danced to it lol I forgot the name of the song but it was funny watching the video of me.

Explanation:

8 0
3 years ago
Read 2 more answers
Critical thinking questions
Scrat [10]

Answer:

1: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too.

2: The loop increments the value of new while the loop condition is true. The end value of new is 3.

3: We could use some sort of finger recognition or face so they don’t have to type in their password.

4: give them a second chance for their date of birth.

5: sum = 0 must be before for loop. If inside for loop, it will keep resetting sum to 0 each iteration.

Explanation:

8 0
1 year ago
Jesse is writing a physics quiz about the motion of a roller coaster cart. He has a clip art illustration of a cart rolling hori
Aleks04 [339]
<span>editing the image file in a dedicated photo editing program before inserting it</span>
8 0
3 years ago
Other questions:
  • Design a flowchart or pseudocode for a program that accepts three numbers from a user and displays a message if the sum of any t
    9·1 answer
  • Dinah is using an IDE to write, modify, and save code. Which tool should she use?
    11·2 answers
  • Can you tell me what is rast
    5·1 answer
  • Shawn thought that the screen of the block-based program he was using was
    15·1 answer
  • A researcher plans to identify each participant in a certain medical experiment with a code consisting of either a single letter
    10·1 answer
  • You are a visitor at a political convention with delegates; each delegate is a member of exactly one political party. It is impo
    14·1 answer
  • Which external reference is formatted correctly?
    6·2 answers
  • 3. Touch screens are both input and output devices. Describe one application where a touch screen is used as an output device. (
    7·2 answers
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
  • the image on the right was prooduced by a computer. it shows a complex molecu;e consisting of many atoms. what would be an advan
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!