#01
dir(__builtins__)
#02
help(abs)
#03
5 % 2
7 % 3
#04
def increment(x):
return x+1
#05
sent = "I\'m feeling good."
sent = "I'm feeling good."
sent = 'I\'m feeling good."
#06
print("ba"+"na"*2+"muffin.")
#07
age=input("How old are you?")
#08
def comp(n):
if n>100:
return "More than 100."
elif n>10:
return "More than 10, but equal to or less than 100."
else:
return "Equal to or less than 10."
#09
'mile' in 'smiles'
'smiles' in 'mile'
#10
len('Hello')
#11
s='Call Me Maybe'
s[12]
s[-1]
s[:4]
s=s[:-5]+'Perhaps'
s=s[0:-5]+'Perhaps'
#12
s.find("function")
s.count("function")
s.lower()
#13
for vowel in 'aeiou':
print(vowel)
#14
num=6
while num>0:
print(num)
num=num-1
#15
temperature = [18, 20, 22.5, 24]
temperature[3]
temperature[3:]
#16
len(["math"])
len("math")
#17
grades=[80, 90, 70]
grades.append(3)
grades.pop()
grades.extend([99,77])
grades.remove(70)
#18
grades.sort()
#19
range(1,10,2)
lst=[1, 2, 3]
range(len(lst))
#20
lst=[[10,20],[15],[40,22]]
total=0
for sublist in lst:
for num in sublist:
total=total+num
#21
cat_file = open("cat.txt", "r")
cat_string= cat_file.read()
#22
import os
os.getcwd()
#23
import os
os.chdir("tempDir")
#24
tyImmutableList = (2, 3, 5)
tyDict = {'a':1, 2:'b'}