
Explore Python, the language Guido van Rossum introduced in 1991, and learn why its clear syntax and versatility empower data science, scientific computing, AI, chemistry applications.
Learn to use Python's input function to collect user data, including integers, floats, and strings. See practical examples that ask for age and name and print the results.
Compute density by taking mass in grams and volume in cubic centimeters as float inputs, then divide mass by volume and print the result, rounding to three decimals with examples.
Explore the concept of strings by examining characters, indices, and zero-based indexing, including accessing elements, using -1 for the last, and slicing, as in I love science.
Explore string fundamentals and manipulation methods in Python, including length, type conversion (numbers to strings and strings to numbers), indexing, slicing, and f-strings with examples like I love programming.
Learn how SMILES encodes molecular structures as text, representing bonds, rings, branching, and stereochemistry, with practical examples and 3D structure generation in computational chemistry.
Learn to solve chemistry problems with Python by analyzing smiles strings to count carbon atoms, check for alcohol groups and double bonds, and build chemical equations using string operations.
Explore how to analyze smiles strings representing organic molecules using Python string methods to count carbon atoms, detect alcohol groups, and identify double bonds.
Learn string manipulation to replace aldehyde and hydroxyl groups with a carboxylic acid for compounds one to three, then concatenate components to form a chemical equation with reagents and products.
Master conditional statements in Python by using if, elif, and else to decide outputs based on numeric comparisons, such as greater than, equal to, or less than.
Learn to use if, else, and elif in Python to implement conditional logic with indentation. Explore intermediary conditions like less than one, between one and two, between two and three.
Practice two Python exercises on operators and conditional statements to classify molecules by functional groups (alcohol, aldehyde, carboxylic acid, hydrocarbon) and to detect double bonds and heavier atoms from SMILES.
Write a Python program that reads a smiles string and detects double bonds and heteroatoms, then shows whether the molecule has double bonds, heteroatoms, or both.
Learn a Python exercise to classify a molecule's functional group from a smiles string, identifying alcohol, aldehyde, or hydrocarbon with conditional logic. It covers handling input case and rule-based output.
Write a Python program that names organic molecules from a string input by prefix (carbons), infix (double bonds up to two), and suffix (functional group), ignoring radicals.
Create a python program that generates the name of an organic compound from a smiles code, using prefixes for carbon count, infix for double bonds, and suffixes for functional groups.
Develop a Python program that names organic molecules by counting carbons, double bonds, and functional groups to determine the suffix and infix for carboxylic acids and alcohols.
Discover the concept of loops in Python, including for loops and while loops, to automate tasks by iterating over numbers and characters and updating conditions.
Explore for loops in Python to iterate over numbers with range, strings, and lists, print elements, and apply simple operations, noting range bounds and variable naming.
Explore nested for loops in Python by using an outer loop over range(1,11) and an inner loop over range(1,11). This yields 100 iterations and prints the i and j values.
Practice Python loops to solve chemistry problems, calculating molecular weights for substances composed of carbon, hydrogen, and oxygen, and using a while-loop driven menu to apply the ideal gas law.
Use Python to calculate the molecular weight of carbon, hydrogen, and oxygen substances by defining atomic masses and looping through multiple molecules, printing each substance's grams per mole.
Create a Python menu to solve the ideal gas law, calculating P, V, T, or n from user input, with option validation and results in Kelvin.
Explore Python data structures, focusing on tuples, lists, and dictionaries; learn indexing, slicing, and how to add or remove elements in lists and use key–value pairs in dictionaries.
Explore tuples, a collection that stores multiple values in parentheses with comma-separated elements. Access, slice, and iterate by indexing with brackets, including retrieving the last element.
Explore how to work with nested data structures in Python, including lists, tuples, and dictionaries, and learn techniques to index, iterate, and access elements and coefficients.
Create a three-part Python exercise set that uses loops to compute molecular weights for carbon, hydrogen, and oxygen, stores results with lists and dictionaries, and extracts chemical elements with sets.
Build a Python program that calculates molecular masses for multiple molecules from user input, using carbon, hydrogen, and oxygen counts and prints molar weights in grams per mole.
Calculate molecular masses for multiple molecules using a dictionary of atomic masses, taking user input for carbon, hydrogen, and oxygen counts and printing grams per mole.
Develop a Python tool to compute the empirical and molecular formulas from element percentages and atomic masses, using ratio normalization and a glucose example.
The lecture shows how to obtain the least integer coefficients by converting floating point reaction ratios to integers via successive multiplications, and outlines code to generate integer mols.
Generate the empirical formula of a compound with Python using the least integer moles as coefficients, building the formula string and converting numbers to strings.
Write a Python script to generate a compound’s empirical and molecular formulas, calculating the empirical molar mass and the ratio to derive the molecular formula, e.g., C6H12O6.
Explore the concept of functions in the functional paradigm, defining inputs and data transforms, and outputs, with examples of single and multiple arguments and returning results.
Explore how Python functions act like formulas, taking inputs (parameters) and returning outputs like density, with mass and volume and a quadratic function; future notes mention optional parameters.
Explore advanced Python functions by examining optional parameters, variable scope, nested functions, and strings, and learn to document with docstrings, the help function, and density examples.
Learn three Python functions for chemistry: compute real product mass from yield, calculate pressure with the ideal gas law, and find molecular weight from C, H, and O.
Write a Python function named molecular_weight that computes molecular weight from counts of carbon, hydrogen, and oxygen, using masses twelve, one, and sixteen, with oxygen optional defaulting to zero.
Compute the real product mass from an expected amount and yield percentage using a Python function, with examples 500 mg at 60% and 250 mg at 78%.
Learn how the python math module groups related functions like sqrt, log, pi, e, sin, cos, tan, factorial, and rounding; import math and call functions as math.function using dot notation.
Explore Python's random module to generate numbers and make random selections. Import random, use random(), random.randint(a, b), random.randrange(start, stop, step), and random.choice from a collection.
Write a Python function to compute the pH from a hydrogen ion concentration using minus log base ten, importing the math module.
Create a Python function that takes a tuple of chemical elements and a number, uses the random module to return that many randomly selected elements as a list.
Are you a person with a background in chemistry, engineering, biology, or physical sciences interested in learning a programming language to model problems of chemistry with programming? Or maybe you are someone from a computer science background who is curious about how to model problems of chemistry computationally.
In this course, you'll know how to model different chemistry problems with Python! Through each section, you'll learn (or review) basic concepts of the programming language Python! The following classes are exercises in which I explain some problems of chemistry. After watching these classes, it is expected that you try to solve these problems by yourself. In the following videos, I solve the problems of chemistry step-by-step in the programming language Python.
Each chapter is structured as follows:
Basic lectures about some subjects of Python (variables, data types, loops, etc.
Videos of exercises, in which I explain the problems of chemistry that you must model in Python
Videos of the exercises being solved
Also, there are three projects that you must solve after you watch a certain number of classes. In the first project, you must write code that reads a string of characters representing an organic compound (as SMILES) and generates the name of the compound according to IUPAC rules. In the second project, you must write code that generates the molecular formula of a compound given the elements present in the substance, their molar masses, and their relative amounts in a sample. And finally, in the third project, you must write a program that balances a chemical equation by multiplying the components of the reaction by random coefficients. Each of these projects is cumulative and requires knowledge about the commands and methods that have been seen so far in Python.
Since this course is introductory, we will only use built-in commands and libraries.