<jupyter_start><jupyter_text>Some syntax / basics (Python 3)  Indentation blocksFirst, there are no brackets, braces or semi-colons.Code is organized in python using indentation<jupyter_code>a = True
b = False

if a != b:
    print(a)
else:
    print(b)<jupyter_output>True<jupyter_text>The standard indentation is `4` spaces, which is suggested by the PEP 8 Styleguide. This guide covers everything, such as indentation, comments, function names, etc. Follow this! :)[LINK to PEP 8 Styleguide](https://www.python.org/dev/peps/pep-0008/)  Comments<jupyter_code># This is a single line comment

'''This is a multi-line comment, most often used for
   "DOC STRINGS". Despite this printing out in iPython,
   when used in a script, nothing will print to the
   standard output'''<jupyter_output><empty_output><jupyter_text>Variable TypesYou don't need to assign data types to variables in python. It just figures that out on its own.<jupyter_code>id     = 5                       # integer
weight = 85.5                    # floating point number
name   = 'ryan'                  # string
has_broken_leg = True            # Boolean
grades = ['a','b','c']           # list
values = (1, 2, 3)               # tuple
info = {'a':92, 'b':85, 'c': 76} # dictionary<jupyter_output><empty_output><jupyter_text>Python also determines the necessary output data-type when performing an operation between two different data types.<jupyter_code>id * name<jupyter_output><empty_output><jupyter_text>A boolean `True` has a value of `1`, and a boolean `False` has a value of `0`.<jupyter_code>id * has_broken_leg<jupyter_output><empty_output><jupyter_text>Multiplying lists, repeats them<jupyter_code>id * grades<jupyter_output><empty_output><jupyter_text>BUT, this doesn't work for everything<jupyter_code>id * info<jupyter_output><empty_output><jupyter_text>Not all operations are supported for all data types.  Multiple lines for other thingsThe backslash can be used for continuing lines of code.<jupyter_code>a_long_line = (id * weight) + (id * 5600.09980) * \
              (id * 102.56)<jupyter_output><empty_output><jupyter_text>Strings & Multiple linesThe 'pythonic' way of quoting, or defining a string, is with an apostraphy, but quatations work too.<jupyter_code>my_name = 'ryan'
your_name = "dude"<jupyter_output><empty_output><jupyter_text>With strings, there are multiple ways to continue to the next line<jupyter_code>multi_line_str = ('first line '
                  'second line '
                  'third line')

multi_line_str2 = 'first line ' + \
                  'second line ' + \
                  'third line '
print('1 ' + multi_line_str)
print('2' + multi_line_str2)<jupyter_output>1 first line second line third line
2 first line second line third line<jupyter_text>Lists<jupyter_code>a = [0, 1, 2, 3, 4]
b = ['a','b','c','d']
a + b
a * b
a[:1]

a[2:4]
a[:-1]
a[-1:]<jupyter_output><empty_output><jupyter_text>TuplesTuples work very much like lists, except that their data cannot be changed... like a "read-only" list<jupyter_code>my_tuple = (1, 2, 3)
my_list = [1, 2, 3]

my_tuple[0]
my_list[0]
my_list[0] = 5

my_list
my_tuple[0] = 5

my_tuple<jupyter_output><empty_output><jupyter_text>DictionariesDictionaries consist of key-value pairs, like a hash table. A single dictionary can hold multiple types data types.<jupyter_code>my_dict = {'a':5, 'b': 'ryan', 'c': [1,2,3]}
my_dict['a']
my_dict['c']
for key in my_dict.keys():
    print(key, my_dict[key])<jupyter_output>b ryan
c [1, 2, 3]
a 5<jupyter_text>Type conversionThere is a "built-in" method of looking at the type of a variable<jupyter_code>type('a string')<jupyter_output><empty_output><jupyter_text>Changing the data type of a variable is called "type-casting"<jupyter_code>int(56.010)
float(45)
str(45)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11192853389385181, 'fraction_numerical': 0.021544929059379925, 'mean_word_length': 4.461979913916786, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 58, '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': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '182661', 'license': 'Unlicense', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1299, 'n_words': 384, 'path': 'python_intro_01.ipynb', 'repo_name': 'ryanjdillon/pythonclass', 'size': '3806'}