Skip to content

Instantly share code, notes, and snippets.

/*style*/
#loader {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
width: 150px;
height: 150px;
def compute_percentage():
print("Example...Say you want to know 20% of 100.. Type 100 press enter then 20 then enter :0")
x = input("Give me the percentage to compute(only the number without %): ")
number=int(x)
y = input("Give me what you got in your test: ")
percentage = int(y)
result = (number * percentage)/100
print("{0}% of {1} is: {2}".format(percentage,number,result))
print("\n")
from time import sleep
while True:
print("Welcome to my code on some song suggestions")
choice=input("what mood are you in, Happy, Sad or any other mood")
if choice=="happy":
print("Maybe listen to some pop music or electric music")
sleep(1)
print("Try this song.. https://www.youtube.com/watch?v=ZbZSe6N_BXs ")
@toddmilne13
toddmilne13 / yol0.py
Created January 17, 2018 10:39
rememberingpyhton.py
from time import sleep
bag = ["yuppa", "giggle", "ha", "lol"]
for item in bag:
if item == "yuppa":
print("Hey I found a yuppa!!!!!!")
def namegame(): #name game function
while True:
name = input("Try guess my name, bet you wont do it fam")
@toddmilne13
toddmilne13 / NavBar.html
Created October 20, 2017 11:56
NavBar.html
//CSS//
#nav {
right: 10px;
height: 70px;
background-color: rgb(242, 242, 242);
opacity: 0.6;
width: 100%;
text-align: center;
@toddmilne13
toddmilne13 / Rovercode.py
Last active January 17, 2017 10:31
STJLOL-TM-Code
#code to make rover move forward
#the setup
import RPi.GPIO as GPIO # importing the raspberry as GPIO
from time import sleep #importing sleep to the program
GPIO.setmode(GPIO.BCM) #setting mode to BCM
GPIO.setup(23, GPIO.OUT) #setting up left motor
def compute_percentage():    print("Example...Tell me the 30% of 100 ")    x = input("Give me the number: ")    number=int(x)    y = input("Give me the percentage to compute(insert only the number without %): ")    percentage = int(y)    result = (number * percentage)/100    print("{0}% of {1} is: {2}".format(percentage,number,result))    print("\n")  def find_percentage():    print("Example... x of y what does represent in percentage ?")    first = input("Give me x: ")    x=int(first)    second = input("Give me y: ")    y = int(second)    result = (x*100)/y    print("{0}% of {1} represents the {2}%".format(x,y,result))    print("\n")    print("This is a small program that you can use to compute and find the percentage of a number...")y=2while(y!=0):    x = input("Insert 1 to compute a percentage\n"              "Insert 2 to find the percentage\n"              "Insert 0 to exit\n")    choice = int(x)     if (choice==1):        compute_percentage()    elif (choice==2):        find_percentage()    elif (choice=
print("look what i can do")
ans = "Oranges" + "Apples"
ans=input("What do you get if you add Oranges and Apples... ")
if ans == "OrangeApples":
print("Well done you got it right")
else:
@toddmilne13
toddmilne13 / stjlol-tm-Functionsproject
Created September 28, 2016 15:55
Functions project
#here is a word changer thingamaboba lol
def adoodle(word):
print(word+"???")
print("more like...")
thingy = word+"adoodle"
thingy = thingy.upper()
print(thingy)
print("look at the cool word i just made " + word.upper() +"doodle")
@toddmilne13
toddmilne13 / stjlol-tm-PokemonListsProject
Created September 28, 2016 11:48
Pokemon lists project
bag = ( 'pokeball' , "pokedex" , 'potion' )
print("Welcome to Todds pokemon shop!!")
print("Lets have a look inside your bag!")
print ("This may take a while")
print (bag)