Skip to content

Instantly share code, notes, and snippets.

View santosadrian's full-sized avatar
💭
Buscándome la vida que la muerte viene sola.

Adrian Santos santosadrian

💭
Buscándome la vida que la muerte viene sola.
View GitHub Profile
@santosadrian
santosadrian / scratch.py
Created February 2, 2020 08:51
Example 1
print("Hola mundo")
print("Hola de nuevo")
print("Me gusta escribir esto")
print("Si! Escribiendo.")
print("Seguro que a ti no")
print("I said do not touch this")
@santosadrian
santosadrian / scratch_1.py
Created February 2, 2020 08:52
Example 2
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python
print("I could have code like this") # and the comment after is ignored.
# You can use a comment to "disable" or comment out a piece of code:
# print("This won’t run")
print('This will run.')
@santosadrian
santosadrian / scratch_2.py
Created February 2, 2020 08:54
Example 3
cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print("I will now count my chickens")
print("Hens", 25 + 30 / 6)
print("Rossters", 100 - 25 * 3 % 4)
print("Now I will count the eggs:")
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true that 3 + 2 < 5 - 7?")
@santosadrian
santosadrian / scratch_3.py
Created February 2, 2020 08:56
Example 5
my_name = "John Doe"
my_age = 37 # not a lie
my_height = 180 # centimeters
my_weight = 80 # kilos
my_eyes = 'brown'
my_teeth = 'White'
my_hair = 'Brown'
print(f"Let's talk about {my_name}.")
print(f"He's {my_height} centimeters tall.")
@santosadrian
santosadrian / scratch_4.py
Created February 2, 2020 08:56
Example 6
types_of_people = 10
x = f"There are {types_of_people} types of people."
binary = "binary"
do_not = "don't"
y= f"Those who know {binary} and those who {do_not}"
print(x)
print(y)
@santosadrian
santosadrian / scratch_5.py
Created February 2, 2020 08:56
Example 7
print("Mary had a little lamb.")
print("It's fleece was white as {}.".format('snow'))
print("And everywhere that Mary went.")
print("." * 10) # What'd that do?
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
@santosadrian
santosadrian / scratch_6.py
Created February 2, 2020 08:56
Example 8
formatter = "{} {} {} {}"
print(formatter.format(1, 2, 3, 4))
print(formatter.format("one", "two", "three", "four"))
print(formatter.format(True, False, False, True))
print(formatter.format(formatter, formatter, formatter, formatter))
print(formatter.format(
"Try your",
"Own text here",
"Maybe a poem",
@santosadrian
santosadrian / scratch_7.py
Created February 2, 2020 08:57
Example 9
# Here's some new strange stuff, remember type it exactly.
days = "Mon Tue Wed Fri Sat Sun"
months = "\n Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
print("Here are the days:", days)
print("Here are the months", months)
print("""
There's something going on here.
@santosadrian
santosadrian / scratch_10.py
Created February 2, 2020 08:57
Example 10
tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line"
blackslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""