7 kyu
Four/Seven
1,798 of 4,545beniolenio
Description:
Four Seven
Simple kata, simple rules: your function should accept the inputs 4
and 7
. If 4
is entered, the function should return 7
. If 7
is entered, the function should return 4
. Anything else entered as input should return a false-y value such as False
, 0
, []
, ""
. There's only one catch, your function cannot include if statements (or the eval function due to the fact that you can get around the if requirement using it).
There are some very simple ways of answering this problem, but I encourage you to try and be as creative as possible.
Good Luck!
Puzzles
Similar Kata:
Stats:
Created | Jan 6, 2021 |
Published | Jan 6, 2021 |
Warriors Trained | 7759 |
Total Skips | 143 |
Total Code Submissions | 23586 |
Total Times Completed | 4545 |
Python Completions | 1798 |
Java Completions | 691 |
PHP Completions | 196 |
JavaScript Completions | 1762 |
Haskell Completions | 95 |
λ Calculus Completions | 22 |
C# Completions | 211 |
Total Stars | 91 |
% of votes with a positive feedback rating | 92% of 628 |
Total "Very Satisfied" Votes | 551 |
Total "Somewhat Satisfied" Votes | 56 |
Total "Not Satisfied" Votes | 21 |
Total Rank Assessments | 37 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |