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
What are the responsibilities of the DBA and the database designers?
Ratling [72]

Answer:

Explanation:

DBA's main responsibility is making sure that there is enough CPU, disk, memory, and network bandwidth available, as well as making backups every so often. Meanwhile, the database designers/developers are responsible for investigating and implementing what the end-user needs and making sure that the database holds all of the information that the end-user will be using.

3 0
3 years ago
How do you autofit a column to fit the longest word in Microsoft Word?
sergey [27]

Adjust the table size, column width, or row height manually or automatically. You can change the size of multiple columns or rows and modify the space between cells. If you need to add a table to your Word document.

i hope its right!!!!


5 0
4 years ago
Read 2 more answers
What data type of data type would you use to represent the registration letter of a car​
miss Akunina [59]

Answer:

If it is just one letter, use a character, but if it is more than one letter, use a string (string of characters)

6 0
3 years ago
Read 2 more answers
What is the main function of an operating system​
alina1380 [7]

Here are the main functions of an operating system:

1) Manage the resources of the device

The operating system controls how much of each resource is distributed, and it controls things like the processing unit and memory.

2) Establish a interface for the user of the device

The operating system must classify what the classes of the script/code have to do and what they implement.

3) Service application software

The operating system must service each application that is downloaded onto the device. It must balance it's use of storage between apps.

4 0
3 years ago
Use the Internet identify a problem that social media was used to solve. The problem may be local, national, or global.
ExtremeBDS [4]
What are my options?
5 0
3 years ago
Other questions:
  • Suppose that some company has just sent your company a huge list of customers. You respond to that company with a strongly worde
    15·1 answer
  • Digital Photography Help please
    9·2 answers
  • The document asks about dependents because the number can
    12·2 answers
  • Which of the following is NOT a good idea to do after you change the root password?
    12·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • The ___________ button represents the start of a hyperlink in Table of contents.
    7·1 answer
  • write a program in which the user can enter X amount of numbers. Once the user has enter 10 positive numbers, the user may not e
    7·1 answer
  • In the given switch statement, what will be displayed if the value of var is 3? switch(var) { case 1: System.out.println("Apple"
    12·1 answer
  • To cope with the uncertainty about how their pages will be viewed, many web page designers opt to use _________ units, which are
    13·1 answer
  • One driving technique to increase fuel efficiency is.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!