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
kaheart [24]
4 years ago
11

Can someone help me out with this one? I'm not sure why my code is not working

Computers and Technology
1 answer:
UNO [17]4 years ago
5 0

Answer:

Add this statement at the end of your steps() function

return ""

This statement will not print None at the end of steps.

Explanation:

Here is the complete function with return statement added at the end:

def steps(number):  # function steps that takes number (number of steps to print) as parameter and prints the steps specified by number

   i = 1  #assigns 1 to i

   while i < number + 1:  

       string = str(i) * 3  #multiplies value of i by 3 after converting i to string

       string1 = str(string)  # stores the step pattern to string1

       if i != 0:  # if the value of i is not equal to 0

           string1 = (i * 4*' ' + "\b" + "\b" + "\b" + "\b") + string  #set the spaces between steps

       elif i == 1:  # if value of i is equal to 1

           string1 = string  #set the string to string1

       print(string1)  # print string1

       i = i + 1  # increments i at each iteration

   return "" #this will not print None at the end of the steps and just add a an empty line instead of None.

Screenshot of the corrected program along with its output is attached.

You might be interested in
Which of the following does Moore's law predict?
Korolek [52]

Answer:

Hi!

The correct answer is the a.

Explanation:

The Moore's law is an a empirical law that Gordon Moore predicted doing some observations about how the density of the transistors on a integrated circuit was increasing over time.

For example, this law state that if you have an integrated circuit with: 1000 transistors in 1980 then in 1981 and six months later you will have the same integrated circuit with 2000 transistors, and so on..

  • Jan 1980: 1000 transistors.
  • Jul 1981: 2000 transistors.
  • Jan 1983: 4000 transistors.
  • Jul 1984: 8000 transistors.

And that's the reason because its cost will fall too.

7 0
3 years ago
WILL GIVE BRAINLIEST! The command simplify is used if you only want the first two digits of a decimal to appear in the interpret
Vera_Pavlovna [14]

Answer:

falsee?

Explanation:

8 0
3 years ago
What is the main difference between inserting header/footer in excel and word?​
Zepler [3.9K]

Answer:

Header is at the top of the page and used for epicas and titles, while footers at the bottom are used for footnotes or page number

7 0
3 years ago
Please tell fast plzzzzz​
taurus [48]

Answer:

it can be anything from attachments/images or links

Explanation:

8 0
3 years ago
Read 2 more answers
Identify the type of error.<br> print "hello"<br><br> num = 5 / 0
horrorfan [7]

Answer:

Syntax error

Explanation:

This is a type of error that occurs when there is a problem with the code that makes it unable to compile and execute.

For example, making a conditional statement without using the correct parameters will result in a syntax error.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which command would you use to move a file from one location to another?
    6·2 answers
  • Explain the advantages of taking the aspire test
    15·1 answer
  • Explain why living things store energy in lipids instead of in carbohydrates
    5·1 answer
  • how do I comment on answers? there's one answer I'm confused about but I don't know how to comment on it
    7·2 answers
  • Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )
    9·1 answer
  • Write a Program in C language using arrays:
    14·1 answer
  • This graphics program should draw a caterpillar. A caterpillar has NUM_CIRCLES circles. Use a for loop to draw the caterpillar,
    6·1 answer
  • Which type of project data would you review for an accurate picture of the project progress and labor costs
    8·1 answer
  • Which data type stores a single letter?
    5·1 answer
  • What starts with p and ends with orn
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!