<jupyter_start><jupyter_text>Activity 1: Jupyter Notebook and Python BasicsIn this activity you will first learn how to use Jupyter Notebook. You will then learn a very basic set of Python commands in Jupyter Notebook.So far you should have successfuly installed anaconda, launched Jupyter Notebook, and created your new Python 3 notebook.  Jupyter Notebook Getting to Know your Jupyter Notebook's ToolbarNow let's explore Notebook's toobar:|Button|Function| |--|--||  |This is your save button. You can click this button to save your notebook at any time, though keep in mind that Jupyter Notebooks automatically save your progress very frequently.||  |This is the new cell button. You can click this button any time you want a new cell in your Jupyter Notebook.||  |This is the cut cell button. If you click this button, the cell you currently have selected will be deleted from your Notebook.||  |This is the copy cell button. If you click this button, the currently selected cell will be duplicated and stored in your clipboard.||  |This is the past button. It allows you to paste the duplicated cell from your clipboard into your notebook.||  |These buttons allow you to move the location of a selected cell within a Notebook. Simply select the cell you wish to move and click either the up or down button until the cell is in the location you want it to be.||  |This button will "run" your cell, meaning that it will interpret your input and render the output in a way that depends on what kind of cell you're using.||  |This is the stop button. Clicking this button will stop your cell from continuing to run. This tool can be useful if you are trying to execute more complicated code, which can sometimes take a while, and you want to edit the cell before waiting for it to finish rendering.||  |This is the restart kernel button.||  |This is a drop down menu which allows you to tell your Notebook how you want it to interpret any given cell. You can read more about the different kinds of cells in the following section.| Different kinds of cells1. Code CellsBy default, Jupyter Notebooks' Code Cells will execute Python. Jupyter Notebooks generally also support JavaScript, Python, HTML, and Bash commands. 2. Markdown CellsIn Jupyter Notebooks, Markdown Cells are the easiest way to write and format text.3. Header CellsHeader Cells provide a more deeply structural organization for your Notebook and thus there are several advantages to using them. Python BasicsThe following codes are refresher for those who are familiar and are useful for those who are just starting out.    Hello World<jupyter_code>print("Hello, World!")
# this is our one line comment
print("Hello, World!")<jupyter_output>Hello, World!<jupyter_text>Arithmetic Operators<jupyter_code>print(1 + 2 * 3/2)
print(2 ** 3)
print(22 % 3)
print(2 * 3)
print("hello" * 10)
print('hello','friend')<jupyter_output>hello friend<jupyter_text>Variables and Data Types  1.Number<jupyter_code>#Number
currentYear=2019
print(currentYear)<jupyter_output>2019<jupyter_text>2. String<jupyter_code>#String
sampleString = 'Welcome to FIT1043'
print(sampleString)
#Combining strings
print(sampleString+ ' in semester 2 of '+str(currentYear))<jupyter_output>Welcome to FIT1043 in semester 2 of 2019<jupyter_text>3.List<jupyter_code>#create an empty list
newLst=[]
# add items to the list
newLst.append(1)
newLst.append(2)
newLst.append(2)
newLst.append('hi')
#see the list content
newLst
#access to list items
newLst[2]<jupyter_output><empty_output><jupyter_text>Hint: Index starts from 0 in python<jupyter_code>#Remove an item from the list:remove removes the first matching value, not a specific index
newLst.remove(2)
newLst
#delete an item from the list: Dlete the item basd on its index
del newLst[0]
newLst
# see how many items exist in the list
len(newLst)<jupyter_output><empty_output><jupyter_text>Conditions<jupyter_code>print(currentYear==2019)
print(currentYear!=2019)
if currentYear==2019:
    print('2019 is the current year')
#If operator
if currentYear==2019:
    print('The value of variable currentYear is 2019')
else:
    print('The value of variable currentYear is NOT 2019')
#In operator
if currentYear in [2019,2018]:
    print('The value of variable currentYear is either 2019 or 2018')
else:
    print('The value of variable currentYear is neither 2019 nor 2018')<jupyter_output>The value of variable currentYear is either 2019 or 2018<jupyter_text>Input<jupyter_code>birthYear=input('Please enter your age: ')
print('You were born in',2019-int(birthYear))<jupyter_output>Please enter your age: 35
You were born in 1984<jupyter_text>Problem, we have hard coded 2019! How can we make it dynamic?  Python Packages  Package installation via Jupyter NoteBook!pip install packageNameExample: !pip install pandas, seaborn,.. Import Package import packageNameExample: import pandas, seaborn,..<jupyter_code>import datetime
now = datetime.datetime.now()
birthYear=input('Please enter your age: ')
print('You were born in',now.year-int(birthYear))<jupyter_output>Please enter your age: 35
You were born in 1984
{'fraction_non_alphanumeric': 0.06802988596146284, 'fraction_numerical': 0.025560361777428233, 'mean_word_length': 5.496807151979565, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '291846', 'license': 'MIT', 'n_tokens_mistral': 1567, 'n_tokens_neox': 1428, 'n_words': 679, 'path': 'FIT1043 solns/Week1-notebook/Week1-notebook.ipynb', 'repo_name': 'itsrounak/temp', 'size': '5086'}