<jupyter_start><jupyter_text>Quick Python Overview  Numbers<jupyter_code>2 + 2
25 / 5
5 * 4
3 ** 2
6 % 2
6 % 4
(5 + 2) * ( 4 + 2)<jupyter_output><empty_output><jupyter_text>Booleans<jupyter_code>True
False<jupyter_output><empty_output><jupyter_text>Strings<jupyter_code>"you can use double quotes...."
'... but you can also use single quotes'
"use different quotes if you need to say things like it's great!!!"<jupyter_output><empty_output><jupyter_text>Variables<jupyter_code>my_var = 5
x = 5
y = 15
z = x + y 
z<jupyter_output><empty_output><jupyter_text>Print<jupyter_code>x = 'Nuclear Medicine'
x
print(x)
code = 'PHYS'
number = '541'
print(f'{x} is {code}-{number}')<jupyter_output><empty_output><jupyter_text>Lists<jupyter_code>[5,4,3,2,1]
['Nuclear Medicine','is',1,[5,6]]
isotopes = ['Re-188','Lu-177','Tc-99m']
isotopes.append('Ac-225')
isotopes
isotopes[0]
isotopes[1]
isotopes[1:]
isotopes[:2]
isotopes[0] = 'F-18'
isotopes<jupyter_output><empty_output><jupyter_text>Dictionaries<jupyter_code>decays = {'Lu-177':'Beta', 'Tc-99m':'IT'}
decays
decays['Lu-177']
decays['Tc-99m']<jupyter_output><empty_output><jupyter_text>Tuples<jupyter_code>energies = (140, 113, 208)
energies[0]
energies[0] = 662<jupyter_output><empty_output><jupyter_text>Sets<jupyter_code>{'Lu-177','Tc-99m','F-18'}
{'Lu-177','Tc-99m','F-18', 'Tc-99m','F-18','Lu-177','Lu-177','Tc-99m','F-18'}<jupyter_output><empty_output><jupyter_text>Comparison<jupyter_code>140 > 208
140 < 208
140 >= 140
140 <= 208
140 == 140
'Tc-99m' == 'Tc-99m'
'Tc-99m' == 'Lu-177'<jupyter_output><empty_output><jupyter_text>Logic<jupyter_code>(140 > 208) and (208 < 662)
(140 > 208) or (208 < 662)<jupyter_output><empty_output><jupyter_text>if, elif, else<jupyter_code>if 140 < 208:
    print("I'm Tc-99m")
if 140 < 208:
    print("I'm Tc-99m")
else:
    print("I'm Lu-177")
if 140 > 208:
    print("I'm Tc-99m")
else:
    print("I'm Lu-177")
if 140 == 208:
    print("I'm Tc-99m")
elif 208 == 208:
    print("I'm Lu-177")
else:
    print("I don't know what I am")<jupyter_output><empty_output><jupyter_text>Loops<jupyter_code>energies = [113, 140, 208, 662]
isotopes = ['Lu-177','Tc-99m','Lu-177','Cs-137']
for en in energies:
    print(en)
for iso in isotopes:
    print(iso)<jupyter_output><empty_output><jupyter_text>Functions<jupyter_code>def find_isotope(isotope_name,isotopes):
    for iso in isotopes:
        if iso == isotope_name:
            print(iso)
find_isotope('Lu-177',isotopes)
find_isotope('Tc-99m',isotopes)<jupyter_output><empty_output><jupyter_text>Methods<jupyter_code>sentence = "Theranostics is used to TREAT what we SEE and SEE what we TREAT"
sentence.lower()
sentence.upper()
sentence.split()
decays = {'Lu-177':'Beta', 'Tc-99m':'IT'}
decays.keys()
decays.items()
isotopes = ['Lu-177','Tc-99m','Lu-177','Cs-137']
'Re-188' in isotopes
'Cs-137' in isotopes<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18492672714584787, 'fraction_numerical': 0.09141660851360782, 'mean_word_length': 6.564643799472296, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 66, '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': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '637338', 'license': 'MIT', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1226, 'n_words': 206, 'path': 'Lab1/Lab1_PythonCrashCourse.ipynb', 'repo_name': 'carluri/medimaging_examples', 'size': '2866'}