Skip to content

Instantly share code, notes, and snippets.

View muddlebee's full-sized avatar
🌊
Code surfing

muddlebee

🌊
Code surfing
View GitHub Profile
name = input("Enter your name\n")
weight = float(input("Enter your weight\n"))
print("%s weighs %f kg" %(name,weight))
class Robot:
power = 100
defence = 70
def reverse(name):
if len(name) <= 0:
return
reverse(name[1:])
print(name[0], end='')
reverse("poppy")
def spell_name(hits):
if hits == 0:
return
print("hit "+ str(hits)+" more times")
spell_name(hits -1 )
spell_name(10)
contender = 'Aliens'
def earth():
global contender
contender = 'Avengers'
print( contender + ' ready for battle!')
def universe():
contenders = ‘Fortem’
print(‘outside Earth ’ + contender )
def earth():
contender = ‘Avengers’
print(‘on Earth ’ + contender)
universe()
earth()
def shrink(height,door):
if(height <= door):
print("escape")
return
print("shrink")
height = height/2
shrink(height,door)
shrink(8,2)
romantic={'Titanic','Holiday'}
comedy={'The Proposal','Spy'}
action={'Avatar','Spy'}
movies=romantic.union(comedy,action)
print(len(movies))
mobilePhones = "Shipped"
schoolBooks = "On Way"
print("status:")
print(mobilePhones, schoolBooks)
schoolBooks = "On Way"
print(schoolBooks)
SchoolBooks = "Shipped"
print(SchoolBooks)