Timeline for Concatenating n with n + 1
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 18, 2018 at 3:30 | comment | added | JathOsh | @JoKing Thanks! now i get to learn something more about python, I haven't seen the or operator used like that before | |
Jul 18, 2018 at 3:29 | history | edited | JathOsh | CC BY-SA 4.0 |
deleted 2 characters in body
|
Jul 9, 2018 at 6:28 | comment | added | Jo King♦ |
How about having the condition for 1 inside the format string? 44 bytes
|
|
Jul 9, 2018 at 5:29 | comment | added | JathOsh | @CatWizard Thanks that is super helpful | |
Jul 9, 2018 at 5:28 | history | edited | JathOsh | CC BY-SA 4.0 |
edited body
|
Jul 9, 2018 at 5:12 | comment | added | Wheat Wizard♦ |
An anonymous function is any function that is not associated with a name. In python the lambda keyword makes an anonymous function. Anonymous functions can be set to variables as you did, they can also be called directly without assignment (that's what makes them anonymous) by wrapping them in parentheses e.g. (lambda x:x+1)(6) . For TIO you can put f=\ in the "header" section and call the function with f .
|
|
Jul 9, 2018 at 5:08 | comment | added | JathOsh | @CatWizard Thanks! But what do you mean by anonymous function? is there a way to call an anonymous function? | |
Jul 9, 2018 at 5:06 | history | edited | JathOsh | CC BY-SA 4.0 |
deleted 3 characters in body
|
Jul 9, 2018 at 4:28 | comment | added | Wheat Wizard♦ |
Welcome to the site! You can save bytes by removing the space between your string and the for . Also since this is an anonymous function there is no need for f= , so you can save 2 bytes by removing it.
|
|
Jul 9, 2018 at 4:11 | review | First posts | |||
Jul 9, 2018 at 4:28 | |||||
Jul 9, 2018 at 4:05 | history | answered | JathOsh | CC BY-SA 4.0 |