01-Creating_a_Dictionary.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

#creating a dictionary of key value pairs that stores the names of the upcoming iphones and their release date

#NOT SORTED  - note they are not necessarily printed/displayed in the order you create them! 
future_release = {
		"iphone10" : 2017,
		"iphone 11" : 2018,
		"iphone 12" : 2019,
		"iphone 13" : 2020,
		"iphone 14" : 2021,
		"iphone 15" : 2022
	}

print(future_release)
print()
print()
logindetails={"username":"password","username1":"password1","username2":"password2"}
print(logindetails) 
                    

Try it yourself