nFactorial School Start-Python Project 1
For this project you have to solve 5 problems below. Send 5 separate files to codepost.
File names should be as follows:
● problem1.py
● problem2.py
● problem3.py
● problem4.py
● problem5.py
Good luck! 🍀
1. Check If a Character is a Vowel or Consonant
Write a program that takes a single character as input and checks if it is a vowel, consonant, or
not a letter. For this problem only aeiou are considered to be vowels.
Example:
Input: a
Output: True
Input: b
Output: False
2. Reverse a Three-Digit Number
Take a three-digit number as input and reverse its digits. Leading zeroes are allowed in the
input. For example, input 123 should output 321.
Example:
Input: 546
Output: 645
Input: 001
Output: 100
3. Compare Three Numbers
Take three numbers as input and output them in the ascending order.
Example:
Input: 1
Output: 1 2 3
Input: 19
Output: 3 8 19
4. Count Even and Odd Digits
Take a positive 5-digit integer as input and count how many even and odd digits it has. Leading
zeroes are not allowed in the input. Hint: recall bool -> int conversion.
Example:
Input: 38254
Output: 3 2
Explanation: 38254 has 3 even digits: 38254, and 2 odd digits: 38254.
Input: 24680
Output: 5 0
5. Encode a Message
Take a 3 character string as input, encode each character into its ASCII value. Separate them
by spaces.
Example:
Input: abc
Output: 97 98 99
Explanation: ascii code for ‘a’ is 97, for ‘b’ is 98, and for ‘c’ is 99.
Input: lol
Output: 108 111 108