Skip to Main Content

Introduction to Python

This guide was designed to supplement the INTRODUCTION TO PYTHON virtual workshop. If you have concerns or suggestions for this guide, feel free to reach out to scholarlyengagement@tulane.edu.

What are operators?

Operators allow you to perform mathematical and syntactical processes on your data. Follow along with the code below to learn how to conduct these operations on variables.

In this section, you will learn how to:

  • Conduct basic mathematical operations 

Operators Code for Numeric Data

Operators perform mathematical operations when applied to numeric variables or numerals. Copy the following code on the left in your IDE to execute the process shown in the image on the right.


five = 5                                                                                    
six = 6

print(five + six) #(Addition)
print (five*six) #(Multiplication)
print(five/six) #(Division)
print(five-six) #(Subtraction)
print (five%six) #(Modulo - returns the remain of a division operation)
print (five**six) #(Exponent)

Operators Code for Text Data

Operators perform syntactical edits when applied to text variables or text. Copy the following code on the left in your IDE to execute the process shown in the image on the right.


name = "Jorge"
print(name*4)

name2 = "Jason"
print (name + " " + name2)

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.