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

What are functions?

Functions are groups of statements that perform a specific task on your data. Functions typically take the following structure:

Function(argument1, argument2.....argumentx)

In this section, you will learn how to:

  • Use common functions such as print () 

Common Functions

Copy the following code on the left in your IDE to execute the process shown in the image on the right.

Revealing the Content of a Variable  |  print(argument)

We have used print a couple of times in this guide. Print is one of the most frequently used functions.

name1 ="Raquel"                                                                      
print (name1)




Finding the Highest Number in a List | max(list)

list3 = [1, 17, 25]                                                                  
print (max(list3))




Finding the Lowest Number in a Listmin(list)

list3 = [1, 17, 25]                                                                                           



Finding the Last Word in Alphabetical Order | max(list)

names = ("Xay","Sheila", "Rhonda", "Jay", "Bob")                           




Finding the First Word in Alphabetical Order | min(list)

names = ("Xay","Sheila", "Rhonda", "Jay", "Bob")




Alphabetically Sorting a List of Strings | type(variable)

names = ("Xay","Sheila", "Rhonda", "Jay", "Bob")




View Object Type | type(variable)

name = "Jason"                                 



Absolute Value | abs(number)





Power Function | pow(base, exponent)




Rounding | round(number, decimal places)

print(round (14.9234, 2))                                                        
print(round (14.9234, 3))                         





Finding the Length of a String Variable | len(string)             

name = "Sheila"                                                                                         




Finding the Length of a List | len(list)

cars = ["Toyota", "Honda"]                                                             




Adding Numbers | sum(list of numbers)

summ = sum([1,5,6,7])                                             

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