Skip to content

Repository containing examples of Python code I have written.

Notifications You must be signed in to change notification settings

mchunn-1/Python

Repository files navigation

Python

Repository containing examples of Python code I have written.

Code Description

  • pandasCovidProject: This notebook uses public covid data to examine the relationship between states with high covid-related death rates and states with high poverty, limited education, and no health insurance.
  • fastqPar:This code allows the user to perform two different tasks on a FASTQ file. The first task is to generate an amino acid count from a specified sequence, while the second task is to trim the nucleotide sequence based on the quality score.
  • fastaPar: This code defines a function fastaParser() that reads a fasta file and returns each sequence header and sequence as a tuple. It then defines a main function that calls fastaParser() and prints out each sequence header and sequence.
  • fastaTupPrac: This code reads in DNA sequences from a file in FASTA format and performs several analyses on the sequences.
  • seqOOP: This notenook uses OOP to parse sequences.
  • pandasCovidTS: This notebook uses public covid data to examine trends related to the virus.
  • numFinderFunctions: This code is a number finder. The first function designed uses a brute-force approach. It loops through the entire set of numbers from 0-X, stopping when you've found the "secret" number The second function starts at the midpoint of the range 0 to X, and asks if the secret number is smaller or larger than the midpoint. Based on that answer, the next midpoint is found and the question is asked again, repeating this process until the secret number is found.
  • SeqModification: This code prompts the user to input a DNA sequence and a file name containing a DNA sequence. It then counts the number of G's and C's in the DNA sequence using partA(), and randomly modifies the DNA sequence in the file by replacing bases at random positions using partB(). Finally, it prints the modified DNA sequence to the console.
  • pyCalculations: The code contains several functions that perform different calculations based on user input. The main function is a loop that presents the user with a menu of options and calls the appropriate function based on the user's choice. Function "rubiksHouse" calculates the cost of building a house out of Rubik's cubes based on user input of room dimensions and numbers of rooms. Function "BAContent" calculates a person's blood alcohol content based on their gender, weight, number of drinks, and time since their last drink. Function "coreTravel" calculates the time and cost to travel to the center of the earth based on user input of their driving speed, car's MPG, and the cost of gas per gallon. Function "squidGame" calculates the number of days it would take a person to watch the entire Netflix series "Squid Game" based on their daily viewing hours and estimated bathroom break time. Function "earthCDog" calculates the number of clones of a user's dog it would take to line them up from nose to tail and wrap around the Earth's circumference, based on the dog's length. Function "BMICalc" calculates a user's body mass index based on their height and weight.
  • pyGames: This code is a game simulator that includes three different games: rock paper scissors, heads or tails, and cham cham cham. The main function is the main driver for the game, and it uses conditional statements to determine which game the user wants to play. Each game has its own function: rps for rock paper scissors, headsOrTails for heads or tails, and chamChamCham for cham cham cham.
  • timeConverter:This code takes user input for a duration in seconds, and then calculates the equivalent number of days, hours, minutes, and seconds. It then converts these values to strings and prints them out in descending order of size, along with the remaining seconds.
  • lotteryNumbers: The code generates US Powerball lottery numbers. It defines a ranNumGen function that generates a random integer between two given values, and a main function that uses ranNumGen to generate 5 random white balls and a random power ball between 1 and 26. The code then stores the six random numbers in a tuple called lottery and prints it to the console.