Skip to content

Instantly share code, notes, and snippets.

View 15nmcgoldrick's full-sized avatar

Niamh McGoldrick 15nmcgoldrick

View GitHub Profile
print("type a number between 1 and 10" in english and this programme will translate it into german)
#make sure you type the word eg. one insteaad of the number eg. 1
one = "eins"
two = "zwei"
three = "drei"
four = "vier"
five = "funf"
six = "sechs"
seven = "sieben"
print("welcome to the german test. there will be 10 questions. good luck!")
#make sure to type out your answers in german not english
print("question 1")
print("how do you say dog in german")
answer=input(" ")
if answer == "hund":
print("correct")
else:
#welcome science nerd
print("hello welcome to PH value figure outer")
answer=int(input("hello welcome to the PH value figurer outer"))
neutral = "7"
if ph value >= "7":
print("that is an acid.")
#welcome science nerd
print("hello welcome to PH value figure outer")
answer=int(input("hello welcome to the PH value figurer outer"))
neutral = "7"
if ph value >= "7":
print("that is an acid.")
@15nmcgoldrick
15nmcgoldrick / Homework10.1.7.py
Last active February 7, 2017 10:20
rover code fam
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(23,GPIO.out)
GPIO.setup(17,GPIO.out)
GPIO.setup(16,GPIO.out)
#the code
GPIO.output(16,GPIO.HIGH) #turns green light on
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(23,GPIO.out)
GPIO.setup(17,GPIO.out)
GPIO.setup(16,GPIO.out)
#the code
GPIO.output(16,GPIO.HIGH) #turns green light on
GPIO.output(23, GPIO.HIGH) #turns motor on
@15nmcgoldrick
15nmcgoldrick / s.py
Last active March 7, 2017 10:43 — forked from dobrienSTJ/s.py
IR Rangefinder Rover
#Only in PYTHON2.7
import RPi.GPIO as GPIO #GPIO Libraries
from time import sleep #Sleep Functions
import readchar #keyboards
GPIO.setwarnings(False) #Blocks error warnings
GPIO.setmode(GPIO.BCM) #Setting Up
GPIO.setup(23, GPIO.OUT) #back right
GPIO.setup(24, GPIO.OUT) #front right
while True: #keeps the code running on a loop
from time import sleep
print("whats up pal") #print statement yurt
sleep(10) #code stops for ten seconds
name = input("what is your name") #asks the user a question
def srt()
print("whats up pal v2")
srt() #prints whats up pal v2
class Pizza: #makes a class called pizza
yum=10 #how yum the pizza is
def addsPineapple(self): #reduces the yum by 10
self.yum.=self.yum-10
def addsMushroom(self): #reduces the yum by 9.5
self.yum.=self.yum-9.5
def noPepperoni(self): #reduces the yum by 5
from time import sleep #allows code to take breaks
print("this programme sugests songs for you depending on what mood you are in") #the user sees the sentence in the quotes
mood=input("please select an emotion that you are feeling to recieve your song recomendations("happy, sad, in love, excited, motivated, calm")
if mood == "happy": #programme gives song suggestions for people that are happy
print("“Happy” by Pharrell Williams")
sleep(2) #alows code to stop for two seconds and then continue
print("“Don't Stop Believing” by Journey")
sleep(2) #alows code to stop for two seconds and then continue
print("“Hey Ya!” by OutKast")