DEV Community

Discussion on: Daily Challenge #194 - Spread Number

Collapse
 
mendoza profile image
David Mendoza (He/Him) • Edited

Python

def spreadNumber(n):
    return range(1,n+1)
Collapse
 
rafaacioly profile image
Rafael Acioly

this will not work, it doesn't include the last digit:

spreadNumber(4) => [1, 2, 3]

you forgot to add +1 on n

Collapse
 
mendoza profile image
David Mendoza (He/Him)

You are right, I didnt take that in consideration, but it just range(1,n+1)