This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |