diff --git a/0-fizzbuzz.py b/0-fizzbuzz.py index 36b3e34..ca4c2a5 100755 --- a/0-fizzbuzz.py +++ b/0-fizzbuzz.py @@ -17,10 +17,10 @@ def fizzbuzz(n): tmp_result = [] for i in range(1, n + 1): - if (i % 3) == 0: - tmp_result.append("Fizz") - elif (i % 3) == 0 and (i % 5) == 0: + if (i % 3) == 0 and (i % 5) == 0: tmp_result.append("FizzBuzz") + elif (i % 3) == 0: + tmp_result.append("Fizz") elif (i % 5) == 0: tmp_result.append("Buzz") else: diff --git a/1-print_square.js b/1-print_square.js index 9d30a15..f75b011 100755 --- a/1-print_square.js +++ b/1-print_square.js @@ -14,7 +14,7 @@ if (process.argv.length <= 2) { process.exit(1) } -size = parseInt(process.argv[2], 16) +size = parseInt(process.argv[2]) for (let i = 0 ; i < size ; i ++) { for (let j = 0 ; j < size ; j ++) { diff --git a/2-sort.rb b/2-sort.rb index 367e511..21322c0 100644 --- a/2-sort.rb +++ b/2-sort.rb @@ -11,7 +11,7 @@ # convert to integer i_arg = arg.to_i - + # insert result at the right position is_inserted = false i = 0 diff --git a/3-user.py b/3-user.py index 29e6f5a..32a269e 100755 --- a/3-user.py +++ b/3-user.py @@ -54,7 +54,7 @@ def is_valid_password(self, pwd): return False if self.__password is None: return False - return hashlib.md5(pwd.encode()).hexdigest().upper() == self.__password + return hashlib.md5(pwd.encode()).hexdigest().lower() == self.__password if __name__ == '__main__':