![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 29.07.2020 02:01 eburnhisel2023
Can someone help me out with this one? I'm not sure why my code is not working
Now, let's improve our steps() function to take one parameter
that represents the number of 'steps' to print. It should
then return a string that, when printed, shows output like
the following:
print(steps(3))
111
222
333
print(steps(6))
111
222
333
444
555
666
Specifically, it should start with 1, and show three of each
number from 1 to the inputted value, each on a separate
line. The first line should have no tabs in front, but each
subsequent line should have one more tab than the line
before it. You may assume that we will not call steps() with
a value greater than 9.
Hint: You'll want to use a loop, and you'll want to create
the string you're building before the loop starts, then add
to it with every iteration.
Write your function here
def steps(number):
i = 1
while i < number + 1:
string = str(i) * 3
string1 = str(string)
if i != 0:
string1 = (i * 4*' ' + "\b" + "\b" + "\b" + "\b") + string
elif i == 1:
string1 = string
print(string1)
i = i + 1
#The following two lines will test your code, but are not
#required for grading, so feel free to modify them.
print(steps(3))
print(steps(6)
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 21:00
You should hand write your references on your resume.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 10:00
You need a reliable network for about twenty-five computers that will be distributed across a large building. it is important that the network be relatively cheap. which topology should you use?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:00
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
You know the right answer?
Can someone help me out with this one? I'm not sure why my code is not working
Now, let's improve o...
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 27.07.2019 10:30
![question](/tpl/images/cats/istoriya.png)
History, 27.07.2019 10:30
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 27.07.2019 10:30
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/himiya.png)
Chemistry, 27.07.2019 10:30
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 27.07.2019 10:30
![question](/tpl/images/cats/biologiya.png)
Biology, 27.07.2019 10:30
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 27.07.2019 10:30
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/ekonomika.png)
Business, 27.07.2019 10:30
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 27.07.2019 10:30
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 27.07.2019 10:30
![question](/tpl/images/cats/biologiya.png)
Biology, 27.07.2019 10:30
![question](/tpl/images/cats/biologiya.png)
Biology, 27.07.2019 10:30
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 27.07.2019 10:30