Saturday, 29 November 2014

functions 2



PrintMailMergeItems:

We used 2 functions to create this program. The user enters a name and the program checks if its in the list. if it isn't in the list it adds the name, username and  password.




Saturday, 1 November 2014

Housepoint Calculator



total=0

for i in range(3):
    newnumber=int(input("what the new number?\n"))
    total += newnumber

print("the total number is:",total)





Dictionaries



Saturday, 18 October 2014

Dictionary


Dictionary:

an_example_dictionary ={1:"No Way!",2:"Hatchee How",3:"wambambam",4:"Pow!"}
print(an_example_dictionary)
print(an_example_dictionary[3])



an_example_dictionary2 ={"1":"No Way!","2":"Hatchee How","3":"wambambam","4":"Pow!"}
print(an_example_dictionary2)
print(an_example_dictionary2["3"])






2nd way:

dictionary={}
dictionary['1']=['a','b','c']
print(dictionary)
dictionary['2']=['d','e','f']
print(dictionary)








3rd way:
dictionary_non_literal={}
dictionary_non_literal[1]=['a','b','c']
dictionary_non_literal[2]=['a1','b1','c1']
print(dictionary_non_literal)