<jupyter_start><jupyter_text>Python for Beginners- Your First Line of Python Code**Author:** <NAME> **Date Created:** July 14 2020 **Website:** ajitjohnson.com  Simple arithmetic  operations<jupyter_code>1 + 1
(10 * 500) / (3 ^ 5)<jupyter_output><empty_output><jupyter_text>Using VariablesYou will learn that numbers or strings can be assigned to variable among others which we will learn later.  Variables can be over written.<jupyter_code>x = 1
y = 1
x + y
x = 'Ajit'
y = 'Johnson'
x + y
x = 1
y = 'Johnson'
x + y<jupyter_output><empty_output><jupyter_text>Write your first functionYou will learn how to intialize and run a function.  *A function is a block of organized, reusable code that is used to perform a particular action.*  You will also learn how to add comments to your code.<jupyter_code>def add (a,b):
    sum = a + b
    return sum
add (a = 1, b = 1)
# BMI calculator
# Formula: weight (kg) / [height (m)]2
# 18 to 25 is normal BMI
def bmi (weight, height):
    bmi = weight / (height*height)
    return bmi
bmi (weight = 75, height = 1.8)<jupyter_output><empty_output><jupyter_text>A more *fun* functionYou will learn how to *import* and use packages that has been written by others.  Identify the number of days left to your birthday.<jupyter_code># Import Module/Package
import datetime as dt
now = dt.date.today()
now  
now.year
def daystobirthday (year, month, date):
    
    # Import Module/Package
    import datetime as dt

    # Identify the current date
    now = dt.date.today()
    
    # Set the birth date in package readable format
    birthday = dt.date(year,month,date)
    
    # Identify the number of days left to birthday
    days_left = birthday - now
    
    #days_left = print ('Your Birthday is in ' + str(days_left.days) + ' days.. Yeyyy!!!')
    
    # Return the result
    return days_left
daystobirthday (year=2020, month=10, date=16)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09623430962343096, 'fraction_numerical': 0.019351464435146442, 'mean_word_length': 3.830808080808081, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '414408', 'license': 'MIT', 'n_tokens_mistral': 659, 'n_tokens_neox': 610, 'n_words': 237, 'path': 'assets/data/2020-07-15-python-for-beginners-first-program/.ipynb_checkpoints/2020-07-15-python-for-beginners-first-program-checkpoint.ipynb', 'repo_name': 'ajitjohnson/ajitjohnson.github.io', 'size': '1925'}