 ## Motivation

Learning a programming language can be challenging. Although there are tons of articles and tutorials for learning languages the most important thing is to transfer your knowledge to other real world problems.

## The challenges

The coding challenges are language agnostic so you can use any modern language which supports writing command line applications.

1. Write a script that prints all numbers between 1 and 365 to the console
2. Write a script that prints 10 random numbers between 1 and 10
3. Write a script which converts system input from lower case to uppercase and prints it
4. Write a script that prints all letters from the alphabet (upper case) with their respective position in the alphabet e.g. 1: a, 2: b
5. Write a function which generates random passwords
1. 8 characters in length
2. Must contain at least one alphabet lower case
3. Must contain at least one alphabet upper case
4. Must contain at least one digit
5. Must contain at least one special character from !”§\$%&/?
7. Write a function is_even(num) which returns true if value is even
8. Write a function which returns a list of prime numbers below a given number by using the Sieve of Eratosthenes
9. Have the function first_reverse(input) take the input parameter being passed and return the string in reversed order.
1. For example: if the input string is “Hello World and Coders” then your program should return the string “sredoC dna dlroW olleH”.
10. Have the function compare(num1, num2) take both parameters being passed and
1. return –1 if num1 is less than num2,
2. otherwise return 1.
3. If the parameter values are equal to each other then return 0.
11. Have the function alphabet_soup(input) take the input string parameter being passed and return the string with the letters in alphabetical order (ie. hello becomes ehllo).
1. Assume numbers and punctuation symbols will not be included in the string.
12. Have the function simple_adding(num) add up all the numbers from 1 to num.
1. For example: if the input is 4 then your program should return 10 because 1 + 2 + 3 + 4 = 10.
2. For the test cases, the parameter num will be any number from 1 to 1000.
13. Have the function time_convert(minutes) take the minutes parameter being passed and return the number of hours and minutes the parameter converts to (ie. if minutes= 63 then the output should be 1:03). Separate the number of hours and minutes with a colon.
14. Have the function factorial(num) take the num parameter being passed and return the factorial of it.
1. For example: if num = 4, then your program should return (4 * 3 * 2 * 1) = 24.
2. For the test cases, the range will be between 1 and 18 and the input will always be an integer.
15. Have the function longest_word(sentence) take the sentence parameter being passed and return the largest word in the string.
1. If there are two or more words that are the same length, return the first word from the string with that length.
2. Ignore punctuation and assume sentence will not be empty.
3. Sample Input “fun&!! time”, “I love dogs”
16. Have the function letter_changes(input) take the input parameter being passed and modify it using the following algorithm.
1. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a).
2. Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string.
17. Have the function kaprekars_constant(num) take the num parameter being passed which will be a 4-digit number with at least two distinct digits.
1. Your program should perform the following routine on the number:
2. Arrange the digits in descending order and in ascending order (adding zeroes to fit it to a 4-digit number)
3. subtract the smaller number from the bigger number.
4. Then repeat the previous step.Performing this routine will always cause you to reach a fixed number: 6174.
5. then performing the routine on 6174 will always give you 6174 (7641 – 1467 = 6174).
6. Your program should return the number of times this routine must be performed until 6174 is reached.
7. For example: if num is 3524 your program should return 3 because of the following steps: (1) 5432 – 2345 = 3087, (2) 8730 – 0378 = 8352, (3) 8532 – 2358 = 6174.
18. Have the function simple_symbols(input) take the input parameter being passed.
1. Determine if it is an acceptable sequence by either returning the string true or false.
2. The input parameter will be composed of + and = symbols with several characters between them (ie. ++d+===+c++==a)
3. For the string to be true each letter must be surrounded by a + symbol.
4. So the string to the left would be false, because a is not surrounded by + symbols.
5. The string will not be empty and will have at least one letter.
19. Have the function questions_marks(str) take the str string parameter, which will contain single digit numbers, letters, and question marks.
1. Check if there are exactly 3 question marks between every pair of two numbers that add up to 10.
2. If so, then your program should return the string true, otherwise it should return the string false.
3. If there aren’t any two numbers that add up to 10 in the string, then your program should return false as well.
4. For example: if str is “arrb6???4xxbl5???eee5” then your program should return true because there are exactly 3 question marks between 6 and 4, and 3 question marks between 5 and 5 at the end of the string.
20. Write a function which calculates mean, median and mode of a given integer array
21. Write a function which sorts an integer array with bubblesort
22. Write a function which calculates the greatest common divisor using euclids method (assert 2 == greatest_common_divisor(18, 20))