Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 14, 2022 08:52
Show Gist options
  • Select an option

  • Save RaMSFT/f37d436c96ef03554a965c86fc06254e to your computer and use it in GitHub Desktop.

Select an option

Save RaMSFT/f37d436c96ef03554a965c86fc06254e to your computer and use it in GitHub Desktop.
def num_to_dashes(num):
if num < 1 or num > 60:
return "Wrong input"
else:
return "-" * num
print(num_to_dashes(1))
print(num_to_dashes(5))
print(num_to_dashes(3))
print(num_to_dashes(100))
print(num_to_dashes(-10))
print(num_to_dashes(20))
print(num_to_dashes(0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment