In [2]:
# First list
In [1]:
# Taking off from where I had left off! Lists and Tuples
In [ ]:
In [6]:
values = ['python', 'c' , 'java']
values = values[-3]
print(values.title())
In [14]:
values = ['python' , 'c' , 'java']
values = values[-1]
print(values.title())
In [16]:
values = ['python' , 'c' , 'java']
values = values[-2]
print(values.title())
In [18]:
values =['python' , 'c' , 'java']
values = values[-3]
print(values.title())
In [19]:
#Creating an empty list - and then using it!
In [23]:
usernames = []
# then adding some users
usernames.append( 'peter')
usernames.append('mary')
usernames.append('roderick')
usernames.append('claire')
usernames.append('paul')
#Greet all of our users
for username in usernames:
print("Welcome, " + username.title()+ '!')
In [52]:
# functions! Wow!
In [55]:
# Defining a function
def function_name(argument_1, argument_2):
def Thank_you(name):
#This function prints a two lined note of thanks
print("You are doing good work, %s!" %name)
print("Thank you very much for your efforts at home!")
"Thank_you('Mary')
"Thank_you('Paul')
"Thank_you('Claire')
In [ ]:
#Try again!!
def show_students(students, message):