I am learning the basics of Python from Zed Shaw's Learn Python the Hard Way. I am currently at chapter 36 (Symbol review), and came across the 'as' operator. I need to search for it's uses in Python. I know this question is broad, but I didn't found anything as far on python.docs, or SO. What does this operator do?
It is used to create an alias when importing modules or when using the with
clause:
import pandas as pd
df = pd.DataFrame()
#####
with open(file_name, 'r') as my_file:
my_file.readlines()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With