Name = "John Doe"              # String.
Age = 40                       # Integer.
Height = 180.3                 # Float.
Married = True                 # Boolean (True/False).
Children = ["Emma", "Thomas"]  # List.
Female = False                 # Boolean (True/False).
Interests = []                 # Empty list.

"""
Explanation: Exercise 1: Basics
Goals:
- Manipulate text and number variables
- Print text and numbers together
- Control program flow with if, and for
- Encapsulate related things into functions with def
1. Print variables
Exercise: Print the contents of these variables.
End of explanation
"""


celsius = 5

# Write here

"""
Explanation: 2. Convert celsius to fahrenheit
Exercise: Convert celsius to fahrenheit and store it a new variable. Use this equation: celsius * 1.8 + 32
Present the results in this format: 5 celsius is XXX fahrenheit.
End of explanation
"""


population = 10000000
employed = 4568600

# Round to 1 decimal.
round(3.3333333333, 1)

"""
Explanation: 3. Calculate percentage
Exercise: Caculate the percentage of people who are employed.
Present the results in this format: 11.4 %
End of explanation
"""


Name = "John Doe"
text = "The quick brown fox jumps over the lazy dog"

# Show the first, and fifth character.
print(text[0]) # Note, it starts with 0!
print(text[4])

# Show the first 3 characters.
print(text[0:3])

# Replace text.
print(text.replace("fox", "journalist"))

# Make text lower case, UPPER CASE or Title Case.
print(text.lower())
print(text.upper())
print(text.title())

# Character length.
len(text)

# Find the word "quick". Returns position of first character.
print(text.find("quick"))

# What happens when we don't find the word? It returns -1.
print(text.find("journalism"))

"""
Explanation: 4. Manipulate text
Exercise: Replace Johns last name with your own.
End of explanation
"""


Name = "John Doe"              # String.
Age = 40                       # Integer.
Height = 180.3                 # Float.
Married = True                 # Boolean (True/False).
Children = ["Emma", "Thomas"]  # List.
Female = False                 # Boolean (True/False).
Interests = []                 # Empty list.

if Age == 40:
    print(Name + " is 40 years old.")
else:
    print(Name + " is not 40 years old.")

"""
Explanation: 5. If-statements
Exercise: If John is a male and married, print his age. But if John is male and unmarried, print his height.
Use if and elif.
End of explanation
"""


# Print a range of numbers.
for i in range(5):
    print(i)

# Print each name in the list.
for name in Children:
    print(name)

"""
Explanation: 6. For loops
Exercise: Print names of all children that does not have the name "Emma".
End of explanation
"""


# A function that multiples two numbers together.
def calc(x, y):
    return(x * y)

calc(10, 5)

-

# Number of names in the list.
len(names)

def countE(names):
    # Write here...

"""
Explanation: 7. Functions
Exercise: Write a function that check how many names starts with the letter E.
Break the task down in steps:

Create a new variable called e_letters with the value 0. It will store the number of names with E.
Loop through the list of names.
For each name, check if name starts with the letter E.
Use name.startswith("E") function.
If True, increase e_letters with 1.
End of explanation
"""


