Skip to main content
added 7 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8

Python 3, 52 48 47 4242 41 bytes

lambda a,b:[a,b,*range(a,b,-(a<ba>b)*2-1|1)[1:]]

Try it online!Try it online!


 

---

Combined former implementations.

Python 3, 52 48 47 42 bytes

lambda a,b:[a,b,*range(a,b,(a<b)*2-1)[1:]]

Try it online!


 

Combined former implementations.

Python 3, 52 48 47 42 41 bytes

lambda a,b:[a,b,*range(a,b,-(a>b)|1)[1:]]

Try it online!

---

Combined former implementations.

Saved 5 bytes using only one range.
Source Link
cobaltp
  • 491
  • 4
  • 8

Python 3, 52 48 4747 42 bytes

lambda a,b:[a,b,*range(a+1,b),*range(a-1,b,(a<b)*2-1)][1:]]

Try it online!Try it online!


Combined former implementations.

Python 3, 52 48 47 bytes

lambda a,b:[a,b,*range(a+1,b),*range(a-1,b,-1)]

Try it online!

Python 3, 52 48 47 42 bytes

lambda a,b:[a,b,*range(a,b,(a<b)*2-1)[1:]]

Try it online!


Combined former implementations.

deleted 7 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8

Python 3, 52 4848 47 bytes

lambda a,b:[a,b,*range(a+(a<ba+1,b)*2,*range(a-1,b,(a<b)*2-1)]

Try it online!


EDITED : remove c and switch to lambda function. Credits to @Jo King.Try it online!

Python 3, 52 48 bytes

lambda a,b:[a,b,*range(a+(a<b)*2-1,b,(a<b)*2-1)]

Try it online!


EDITED : remove c and switch to lambda function. Credits to @Jo King.

Python 3, 52 48 47 bytes

lambda a,b:[a,b,*range(a+1,b),*range(a-1,b,-1)]

Try it online!

added 63 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading
added 1 character in body
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading
added 95 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading
deleted 6 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading
Post Undeleted by cobaltp
Post Deleted by cobaltp
Post Undeleted by cobaltp
Post Deleted by cobaltp
Post Undeleted by cobaltp
added 49 characters in body
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading
Post Deleted by cobaltp
Source Link
cobaltp
  • 491
  • 4
  • 8
Loading