HI i am supposed to print out each '-' correspond to the integer number. Please help me as I am not sure where went wrong... (Subject: Python Programming)

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

HI i am supposed to print out each '-' correspond to the integer number. Please help me as I am not sure where went wrong... (Subject: Python Programming)

 

expected output:

-#--#---#----#-----

def represent_numbers(start, end):
string
for i in range (start,end+1):
string += ("-" * abs(i))
print(string ,end
= "#" )
represent_numbers(1,5)
-# ---# ------#
------#
Transcribed Image Text:def represent_numbers(start, end): string for i in range (start,end+1): string += ("-" * abs(i)) print(string ,end = "#" ) represent_numbers(1,5) -# ---# ------# ------#
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT