i want to define a dictionary in python script
i come from china . start to learn python only a week ago
e-mail: zls11610@onestx.com
zls11610
0
Newbie Poster
Recommended Answers
Jump to PostSome options ...
Empty dictionary
d = dict()
ord = {}
Dictionary with predefined valuesd = {1: "Hi there", 2: "Good-bye"}
Dictionary from a list of tuple pairsmypairs = ((1,"Hi there"), (2, "Good-bye")) d = dict(mypairs)
Jeff
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.