Skip to content

Instantly share code, notes, and snippets.

View Ad115's full-sized avatar

Andrés García García Ad115

View GitHub Profile
@Ad115
Ad115 / combination-abstraction.py
Last active September 16, 2018 23:48
Some means of combination and abstraction with Python
"""
Todo buen lenguaje de programación provee de al menos:
- Expresiones primitivas.
- Formas de combinar.
- Formas de abstraer.
A continuación vemos cómo se da eso en Python
"""
# --> Expresiones primitivas:
@Ad115
Ad115 / biopython-sequence.py
Created June 5, 2018 03:26
Introduction to BioPython's Seq objects.
from Bio.Seq import Seq
# Create sequence object
my_sequence = Seq("AGTACACTGGT")
# Show the sequence object
print("Sequence:", my_sequence)
# The sequence was created with a generic alphabet.
# The alphabet tells us whether it is a DNA, RNA or
# Import everything in the p5.py library
from p5 import *
def draw():
# On each frame...
if mouse_is_pressed:
fill(100) # Fill color gray
else:
fill(255) # Fill color white
# Import the turtle graphics module
import turtle
# Create a new turtle with the
# Turtle function of the turtle module
t = turtle.Turtle()
# 100 times...
for x in range(100):
t.forward(x) # Move forward x steps
@Ad115
Ad115 / hello.py
Last active April 20, 2018 22:52
Hello world!
# First program in Python!
print("Hello world!")