Follow annajb
Follow
Following annajb
Following
Add To Collection
Collection
Comments
Devlog
Programming Progress Log
←
Return to Programming Progress Log
Devlog
List Functions
November 14, 2022
by
annajb
friends = ["manni", "zac", "lizzi",] friends.insert(1, "Kelly") friends.remove("lizzi") print(friends.index("manni")) print(friends) friends2 = friends.copy() print(friends2) lucky_numbers = [23, 45,...
Continue reading
Python Classes/Objects
October 24, 2022
by
annajb
class Girl: def __init__(self,name,age): self.name=name self.age=age p2=Girl("Anna", 19) print(p2.name) print(p2.age) Anna 19...
Continue reading
While Loops
October 24, 2022
by
annajb
a=3 while a<10: print(a) a += 3 3 6 9 a=1 while a<10: print(a) a += 3 1 4 7...
Continue reading
Loops
October 16, 2022
by
annajb
#loops message=("python is awesome!") print(message*6) python is awesome!python is awesome!python is awesome!python is awesome!python is awesome!python is awesome! #more loops Days=("Monday=1","Tuesda...
Continue reading
Lists
October 16, 2022
by
annajb
#Lists listOfLights = ["keyLight", "sideLight", "backLight", "fillLight"] print(listOfLights[0]) print(listOfLights[2]) print(listOfLights[3]) print(listOfLights[-1]) print(listOfLights[0:2]) #subsets...
Continue reading
Short Circuit Practice
October 16, 2022
by
annajb
#Short circuit practice x=6 y=2 print(x>=2and(x/y)>2) #True x=1 y=0 print(x>=2and(x/y)>2) #False x=6 y=0 print(x>=2and(x/y)>2) #Calculation fails, causes runtime error as cannot divide by zero. #Guard...
Continue reading
Using Variables
October 15, 2022
by
annajb
sausages=4 beans=100 hashbrowns=2 breakfast=6+8 full_english=7 print("There are",sausages,"sausages available") print("There are",beans,"baked beans on the plate") print("Grandpa likes",hashbrowns,"ha...
Continue reading
Converting degrees to farenheit
October 15, 2022
by
annajb
#Converting degrees to Farenheit print(25*1.8+32) print(30*1.8+32) print(45*1.8+32) print(100*1.8+32) 77.0 86.0 113.0 212.0...
Continue reading
First Code
October 15, 2022
by
annajb
#this is my first code print("Hello, this is my first code") #maths practice print("I will count my pets") print("Dogs",2*3/2) print("Hamsters",10/2) print("Rabbits",5+7) print("All together, I have",...
Continue reading