Ad

Why is the number a str?

Code
Diff
  • def flip_the_number(num):
        return ''.join(reversed(num))
    • def flip_the_number(num):
    • return num[::-1]
    • return ''.join(reversed(num))
Fundamentals
Code
Diff
  • using System;
    
    public class Kata
        {
            public static int Opposite(int n)
            {
                return -n;
            }
        }
    • using System;
    • public class Kata
    • {
    • public static int Opposite(int number)
    • public static int Opposite(int n)
    • {
    • return -number;
    • return -n;
    • }
    • }

Kumite shouldn't count comment markers and comments as lines of code.

Code
Diff
  • // 
    • console.log("<PASSED::>");
    • //
Code
Diff
  • def returnhundred(*_):
        return 100
        
    • def returnhundred(*_):
    • return True*10**2
    • return 100
Code
Diff
  • def returnhundred(*_):
        return True*10**2
        
    • def returnhundred(s):
    • return (True + True + True + True + True + True + True + True + True + True) ** (True + True)
    • def returnhundred(*_):
    • return True*10**2
Code
Diff
  • switchout = str.replace
    • def switchout(sentence, word, switch):
    • return sentence.replace(word, switch)
    • switchout = str.replace
Code
Diff
  • switchout = lambda *_: " g F e D c B a "
    • def switchout(sentence,switchout,word):
    • return sentence.replace(switchout,word)
    • switchout = lambda *_: " g F e D c B a "