<jupyter_start><jupyter_text>Session I: Introduction to Python and Programming Concepts ---  What is Programming? writing a set of instructions for the computer to carry out using a language the computer can understandwriting a set of instructions ---  What is Python? [Here](https://www.python.org/doc/essays/blurb/) is a link to the full, 50&xa2; word description of Python. This big take-away keywords to know are:1. *Scripted Language*: supports running scripts2. *Interpreted*: an 'interpreter' translates the code as it comes to it, instead of compiling it beforehand3. *Object-oriented*: everything is an 'object', or something that contains data (*attributes*) and/or functions that it can do (*methods*)  Some of the 'Pros' of Python:1. Designed to be easily readable2. Very quick development time (e.g. Easier to write)3. Works on almost every platform4. Easily scalable (e.g. Can be run on distributed computing environments)5. Efficiently 'glues' other languages and components together6. Very strong Open-source community<jupyter_code># Zen of Python
import this<jupyter_output>The Zen of Python, by <NAME>

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!<jupyter_text>Some of the 'Cons' of Python:1. Difficult to parallelize2. Generally slower compared to other languages3. Has a little of a learning curve when specializing in niche areas4. Very strong Open-source community ---  How important is readability? ![](./figures/paragraph.png) Can you visually tell the separation of thoughts in both of these examples? Everything in Python is grouped by whitespace. Like the 'Reverse Indentation format' example above, blocks of thought/instructions are grouped by indenting.<jupyter_code># An example
a_list = list(range(10))

for each_item in a_list:
    if each_item % 2 == 0: # this is called a modulo: gives the remainder after division
        print(each_item, 'is Even')
    else:
        print(each_item, ' is Odd')
else:
    print('List Processed')<jupyter_output>0 is Even
1  is Odd
2 is Even
3  is Odd
4 is Even
5  is Odd
6 is Even
7  is Odd
8 is Even
9  is Odd
List Processed<jupyter_text>What does bad code look like? Readability and brevity matter in programming. In [this](./datasets/prog.c) example, you see a clear example of why readability is important. Can you, even as a non-coder, tell me what components of this C program belong to which? And like readability, to the reader of your code, brevity does too. Here is another [example](./datasets/csv_manip.c) of another C program that manipulates a CSV file.  What about good-ish code? Here is an [example](./datasets/csc_manip.py) of Python script that does the same thing that the C script does. Both brevity and readability are somewhat present here. Think of script like a paper you would write for a journal:| Paper Component | Coding Counterpart || :-- | :-- || Nouns | Variables || Verbs | Operators || Sentences | Lines || Paragraphs | Functions || Sections | Modules |  In Summary Python is a great language for all skill levels. Not only does the readability and ease-of-use help beginners to learn, but also there is a *very* active job market for Python developers in everything from biomedical research to Web Development to Netflix & Disney. It is, however, important to say that Python is just a tool...and not the only one. A programming language should be used when it answers a programmatic question you are trying to solve.* For Prototyping and quickly exploring data, R is an easy choice* For high-speed, high-throughput, parallel computing; C/C++ is a great option* For web development or internet facing applications, it is hard to beat JavaScriptWhile Python can do all these things, these others are often better at it. --- NoodlesWrite down all the steps it would take to get noodles into your mouth from the starting point of not having any noodles. ---  Challenge This is meant to be a challenge, and if you don't get it, don't worry. The purpose is to make you think about how you would solve it. Go to [basic_script.py](./basic_script.py), and write your first program. Now run you program by running the cell below<jupyter_code>!python basic_script.py<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06360708534621579, 'fraction_numerical': 0.006038647342995169, 'mean_word_length': 4.366090712742981, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '490906', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1267, 'n_words': 733, 'path': 'session1.ipynb', 'repo_name': 'betteridiot/biocomp_bootcamp', 'size': '4972'}