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
What are the 3 attributes of information?
Anton [14]

As previously said, the three highly important qualities of validity, accuracy, and completeness can be expanded into the information quality of integrity.

For information to be valuable and to meet the definition of information, it must largely have the characteristics of relevance, availability, and timeliness. Accuracy, completeness, consistency, distinctiveness, and timeliness are five qualities of high-quality information. For information to be accurate and valuable, it must be of high quality. Standard attributes, commonly referred to as global attributes, work with a wide variety of elements. The essential attributes such as accesskey, class, contenteditable, contextmenu, data, dir, hidden, id, lang, style, tabindex, and title are included in them.

Learn more about information here-

brainly.com/question/5042768

#SPJ4

4 0
1 year ago
Which set of symbols can be used to determine which calculations to perform first?
Monica [59]

Answer:

parentheses

Explanation: hope i helped <3 °ω°

5 0
3 years ago
Read 2 more answers
This may vary in your state, but S/P2 recommends keeping all environmental documentation a minimum of:
Anettt [7]

A would be the answer!!!...

4 0
3 years ago
Read 2 more answers
How are status reports useful
valentinak56 [21]

Answer:

Project managers use status reports to keep stakeholders informed of progress and monitor costs, risks, time and work. Project status reports allow project managers and stakeholders to visualize project data through charts and graphs.

5 0
3 years ago
I cant see the answers because the stars are blocking them how can this be fixed
viva [34]

I'm sorry whats your question?

7 0
3 years ago
Other questions:
  • Electrical pressure is also called
    5·2 answers
  • To access WordPad, Jill will click on Start, All Programs, Accessories, and WordPad. To access Notepad, Karl will click on Start
    11·1 answer
  • Which method deletes a footer from a document?
    13·2 answers
  • You are the administrator of the Sybex website. You are working when suddenly web server and network utilization spikes to 100 p
    15·1 answer
  • A popular encryption method used to protect data that travel over a wireless network is ___
    15·1 answer
  • The alumni development office at your university uses specialized software that can be accessed from two different servers. The
    12·1 answer
  • Simplify the expresion<br>12. 12g + 9g​
    13·1 answer
  • Can anyone fill in the space please
    6·1 answer
  • Complete the sentence.<br> Python is a_____<br> level language compared to bytecode.
    7·2 answers
  • Transitive spread refers to the effect of the original things transmitted to the associate things through the material, energy o
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!