Skip to content

Instantly share code, notes, and snippets.

View abuzar01440's full-sized avatar
💭
Research

Abuzar Shahid Bhutta abuzar01440

💭
Research
View GitHub Profile
@AnisahTiaraPratiwi
AnisahTiaraPratiwi / AllLoops5.py
Created March 20, 2021 16:13
The counter function counts down from start to stop when start is bigger than stop, and counts up from start to stop otherwise. Fill in the blanks to make this work correctly.
def counter(start, stop):
x = start
if start > stop:
return_string = "Counting down: "
while x >= stop:
return_string += str(x)
if x > stop:
return_string += ","
x -= 1
else: