<jupyter_start><jupyter_text>Python for data science  This course covers the key Python skills you’ll need so you can start using Python for data science. The course is ideal for someone with some previous coding experience who wants to add Python to their repertoire or level up their basic Python skills - Python was named for the British comedy troupe Monty Python    <NAME>- <NAME> is a Dutch programmer best known as the author of the Python programming language Just for fun, try reading over the code below and predicting what it's going to do when run. (If you have no idea, that's fine!)<jupyter_code>amount = 0
print(amount)


amount = amount + 4

if amount > 0:
    print("we have some amount")

total_amount = "amount " * amount
print(total_amount)<jupyter_output>0
we have some amount
amount amount amount amount<jupyter_text>Let's review the code from top to bottom.<jupyter_code>amount = 0<jupyter_output><empty_output><jupyter_text>Variable assignment: Here we create a variable called amount and assign it the value of 0 using =, which is called the assignment operator    Aside: If you've programmed in certain other languages (like Java or C++), you might be noticing some things Python doesn't require us to do here - we don't need to "declare" amount before assigning to it - we don't need to tell Python what type of value spam_amount is going to refer to. In fact, we can even go on to reassign amount to refer to a different sort of thing like a string or a boolean.<jupyter_code>print(amount)<jupyter_output>0<jupyter_text>Function calls - print is a Python function that displays the value passed to it on the screen. We call functions by putting parentheses after their name, and putting the inputs (or arguments) to the function in those parentheses.<jupyter_code># we add more four to amount
amount = amount + 4<jupyter_output><empty_output><jupyter_text>The first line above is a comment. In Python, comments begin with the  symbolNext we see an example of reassignment. Reassigning the value of an existing variable looks just the same as creating a variable - it still uses the = assignment operator.In this case, the value we're assigning to amount involves some simple arithmetic on its previous value. When it encounters this line, Python evaluates the expression on the right-hand-side of the = (0 + 4 = 4), and then assigns that value to the variable on the left-hand-side.<jupyter_code>if amount > 0:
    print("we have some amount")

total_amount = "amount " * amount
print(total_amount)<jupyter_output>we have some amount
amount amount amount amount<jupyter_text>- We won't talk much about "conditionals" until later, but, even if you've never coded before, you can probably guess what this does. Python is prized for its readability and the simplicity.- Note how we indicated which code belongs to the if. "we have some amount"  is only supposed to be printed if amount is positive.- But the later code (like print(total_amount)) should be executed no matter what. How do we (and Python) know that?- The colon (:) at the end of the if line indicates that a new "code block" is starting. Subsequent lines which are indented are part of that code block. Some other languages use {curly braces} to mark the beginning and end of code blocks. Python's use of meaningful whitespace can be surprising to programmers who are accustomed to other languages- The later lines dealing with total_amounnt are not indented with an extra 4 spaces, so they're not a part of the if's code block. We'll see more examples of indented code blocks later when we define functions and using loops. "we have some amount" Strings can be marked either by double or single quotation marks.<jupyter_code>total_amount = "amount " * amount
print(total_amount)<jupyter_output>amount amount amount amount<jupyter_text>The * operator can be used to multiply two numbers (3 * 3 evaluates to 9), but amusingly enough, we can also multiply a string by a number, to get a version that's been repeated that many timesPython offers a number of cheeky little time-saving tricks like this where operators like * and + have a different meaning depending on what kind of thing they're applied to.  Thanks for watching<jupyter_code>from IPython.core.display import HTML
def css_styling():
    styles = open("styles/custom.css", "r").read()
    return HTML(styles)
css_styling()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.053826936179877355, 'fraction_numerical': 0.0036338859868271633, 'mean_word_length': 4.840848806366048, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '377532', 'license': 'MIT', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1105, 'n_words': 645, 'path': 'Introduction-of-python.ipynb', 'repo_name': 'machine-learning-at-karkhana/python-for-data-science', 'size': '4423'}