Welcome to the first chapter of our Python tutorial for beginners using Bible stories! In this chapter, we'll explore the story of creation and learn about variables and basic data types in Python.

Read the Bible

Genesis 1:1-31

Reflection Questions

  1. Which elements of creation stood out to you the most?
  2. Can you think of any ways we might represent the different aspects of creation using programming concepts?

Learn about Programming

Variables

In programming, we often need to store and manipulate information. One way to do this is by using variables. A variable is like a container that can hold a value. We can give each variable a name, and then use that name to refer to the value stored in the container. To create a variable, we assign a value to a name using =.

For example, in the creation story, we can use variables to represent different elements of creation. Here's how we might create variables for the first three days of creation:

day1 = "Light"
day2 = "Sky"
day3 = "Land"

Creation.gif

In this example, we made three variables named day1, day2, and day3. Each variable stores a value that represents a part of creation from the first three days. Once you have created the variables, use the print() function to display their values. Here's an example of how to print the value of a variable:

day1 = "Light"
print(day1) # Output: Light

<aside> 💡 Did You Know?

In this chapter, we are using two functions called print() and type(). Functions are like little helpers in programming that perform specific tasks. We will learn more about functions in Chapter 4, but for now, just remember:

Don't worry if you don't understand everything about functions yet. We will dive deeper into the concept in Chapter 4!

</aside>

Data Type - String, Integer, Floating Number

In Python, there are several basic data types that we can assign to a variable, including:

# String 
day1 = "Light"
print(day1) # Output: Light
print(type(day1)) # Output: <class 'str'>