Created
October 18, 2022 03:59
-
-
Save RaMSFT/1139d9785c33f8079ef7eead963185f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def on_off_switch(switches): | |
| # ** operator in Python works as power | |
| posibilities = 2 ** switches | |
| return posibilities | |
| print(on_off_switch(1)) | |
| print(on_off_switch(3)) | |
| print(on_off_switch(10)) | |
| print(on_off_switch(21)) | |
| print(on_off_switch(24)) | |
| print(on_off_switch(4)) | |
| print(on_off_switch(6)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment