<jupyter_start><jupyter_text>An introduction to solving biological problems with Python- Our course webpage: https://pajtraining.github.io/- Python website: https://www.python.org/ - [Python 3 Standard Library](https://docs.python.org/3/library/index.html])  Learning objectives- **Recall** what we've learned so far on variables, common data types and collections- **Propose and create** solutions using these concepts in an exercise- **Use** conditions to execute specific code block- **Employ** loops to repeat code block- **Practice** reading and writing files with Python- **Solve** more complex exercises  Course schedule - day two- 09:30-09:45: [0h15] **Introduction**- 09:45-10:45: [1h00] **Session 2.1** - Conditional execution- 10:45-11:00: *break*- 11:00-12:30: [1h30] **Session 2.2** - Loops- 12:30-13:30: *lunch break*- 13:30-15:00: [1h30] **Session 2.3** - Files- 15:00-15:15: *break*- 15:15-16:15: [1h00] **Session 2.4** - Delimited files- 16:15-16:30: *break*- 16:30-17:00: [0h30] **Wrap-up**  What we've learned so far- Simple data types, Collections- Functions used so far...  Simple data types<jupyter_code>## Integer
i = 1
print('Integer:', i)
## Float
x = 3.14
print('Float', x)
## Boolean
print(True)
## String
s0 = '' # empty string
s1 = 'ATGTCGTCTACAACACT' # single quotes
s2 = "spam's" # double quotes
print(s1 + s2) # concatenate
print(s1, s2) # print<jupyter_output>ATGTCGTCTACAACACTspam's
ATGTCGTCTACAACACT spam's<jupyter_text>Collections<jupyter_code>## Tuple - immutable
my_tuple = (2, 3, 4, 5)
print('A tuple:', my_tuple)
print('First element of tuple:', my_tuple[0])
## List
my_list = [2, 3, 4, 5]
print('A list:', my_list)
print('First element of list:', my_list[0])
my_list.append(12)
print('Appended list:', my_list)
my_list[0] = 45
print('Modified list:', my_list)
## String - immutable, tuple of characters
text = "ATGTCATTT"
print('Here is a string:', text)
print('First character:', text[0])
print('Slice text[1:3]:', text[1:3])
print('Number of characters in text', len(text))
## Set - unique unordered elements
my_set = set([1,2,2,2,2,4,5,6,6,6])
print('A set:', my_set)
## Dictionary
my_dictionary = {"A": "Adenine", 
                 "C": "Cytosine", 
                 "G": "Guanine", 
                 "T": "Thymine"}
print('A dictionary:', my_dictionary)
print('Value associated to key C:', my_dictionary['C'])<jupyter_output>A dictionary: {'A': 'Adenine', 'C': 'Cytosine', 'G': 'Guanine', 'T': 'Thymine'}
Value associated to key C: Cytosine<jupyter_text>Functions used so far...<jupyter_code>my_list = ['A', 'C', 'A', 'T', 'G']
print('There are', len(my_list), 'elements in the list', my_list)
print('There are', my_list.count('A'), 'letter A in the list', my_list)
print("ATG TCA CCG GGC".split())<jupyter_output>There are 5 elements in the list ['A', 'C', 'A', 'T', 'G']
There are 2 letter A in the list ['A', 'C', 'A', 'T', 'G']
['ATG', 'TCA', 'CCG', 'GGC']
{'fraction_non_alphanumeric': 0.1841018582243634, 'fraction_numerical': 0.05196145905024088, 'mean_word_length': 5.006198347107438, 'pattern_counts': {'":': 4, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '22694', 'license': 'Unlicense', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1044, 'n_words': 319, 'path': 'python_basic_2_intro.ipynb', 'repo_name': 'pajtraining/python-basic', 'size': '2906'}