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:

CreatedJan 6, 2021
PublishedJan 6, 2021
Warriors Trained7759
Total Skips143
Total Code Submissions23586
Total Times Completed4545
Python Completions1798
Java Completions691
PHP Completions196
JavaScript Completions1762
Haskell Completions95
λ Calculus Completions22
C# Completions211
Total Stars91
% of votes with a positive feedback rating92% of 628
Total "Very Satisfied" Votes551
Total "Somewhat Satisfied" Votes56
Total "Not Satisfied" Votes21
Total Rank Assessments37
Average Assessed Rank
7 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • beniolenio Avatar
  • Chris_Rands Avatar
  • JohanWiltink Avatar
  • B1ts Avatar
  • Blind4Basics Avatar
  • hobovsky Avatar
  • Kacarott Avatar
  • NikCSharp Avatar
Ad