diff --git a/Solutions by Yuting/Solution1.py b/Solutions by Yuting/Solution1.py new file mode 100644 index 00000000..4f525ffc --- /dev/null +++ b/Solutions by Yuting/Solution1.py @@ -0,0 +1,8 @@ +from typing import List +def find_numbers(nums: List[int], divisible_by: int, not_multiple_of: int) -> str: + if len(nums) == 0: return "" + return ",".join((str(num) for num in nums if num % divisible_by == 0 and num % not_multiple_of != 0)) +if __name__ == "__main__": + sample_entry = list(range(2000,3201)) + sample_result = find_numbers(nums = sample_entry, divisible_by=7, not_multiple_of=5) + print(sample_result) diff --git a/Solutions by Yuting/Solution2.py b/Solutions by Yuting/Solution2.py new file mode 100644 index 00000000..db2063a6 --- /dev/null +++ b/Solutions by Yuting/Solution2.py @@ -0,0 +1,21 @@ +''' +Question: +Write a program which can compute the factorial of a given numbers. +The results should be printed in a comma-separated sequence on a single line. +Suppose the following input is supplied to the program: +8 +Then, the output should be: +40320 +''' +def factorial_calculator(n: int) -> str: + # By mathematical definition, 0! (zero factorial) is equal to 1. + # This is a standard convention used in combinatorics and algebra. + ans = 1 + for i in range(1, n + 1): + ans *= i + return str(ans) + +if __name__ == '__main__': + sample_input = 8 + sample_result = factorial_calculator(sample_input) + print(sample_result) \ No newline at end of file diff --git a/Solutions by Yuting/test.py b/Solutions by Yuting/test.py new file mode 100644 index 00000000..7df869a1 --- /dev/null +++ b/Solutions by Yuting/test.py @@ -0,0 +1 @@ +print("Hello, World!") diff --git a/comic.png b/comic.png deleted file mode 100644 index 2ff864e7..00000000 Binary files a/comic.png and /dev/null differ