1) Using the dictionary and answer the questions: capitals={"Peru":"Lima","UAE":"Abu Dhabi","Zambia":"Lusaka", "Germany":"Berlin","Portugal":"Lisbon","China":"Beijing", "Jordan":"Cairo"}..How can you print the capitals dictionary? a) print(capitals["Jordan"]) b) capitals["Jordan"]="Amman" c) print(capitals) 2) Using the dictionary and answer the questions: capitals={"Peru":"Lima","UAE":"Abu Dhabi","Zambia":"Lusaka", "Germany":"Berlin","Portugal":"Lisbon","China":"Beijing", "Jordan":"Cairo"}..Write down the statement to check the value of Jordan(the key). a) print(capitals["Jordan"]) b) capitals["Jordan"]="Amman" c) print(capitals) 3) Using the dictionary and answer the questions: capitals={"Peru":"Lima","UAE":"Abu Dhabi","Zambia":"Lusaka", "Germany":"Berlin","Portugal":"Lisbon","China":"Beijing", "Jordan":"Cairo"}..The entry for the capital of Jordan is wrong. Write the statement to change it. a) print(capitals["Jordan"]) b) capitals["Jordan"]="Amman" c) print(capitals) 4) Using the dictionary and answer the questions: capitals={"Peru":"Lima","UAE":"Abu Dhabi","Zambia":"Lusaka", "Germany":"Berlin","Portugal":"Lisbon","China":"Beijing", "Jordan":"Cairo"}..Write the statement to print the capitals for the UAE and China (choose 2 answers) a) print(capitals["Jordan"]) b) print(capitals["UAE"]) c) print(capitals["China"]) d) print(capitals["Germany"]) 5) Create a dictionary to store values for the following keys:name,age,gender and class. a) Info=("Mohamed","14","M","9") b) Info=["Mohamed","14","M","9"] c) Info={"name":"Mohamed","age":"14","gender":"M","class":"9"} d) Info={"name","age","gender","class"} 6) Info={"name":"Mohamed","age":"14","gender":"M","class":"9"} .. Change the age in your dictionary a) Info["name"]=13 b) Info=["13"] c) Info["age"]=13 7) Info={"name":"Mohamed","age":"14","gender":"M","class":"9"}. What statement would you use to check and print the name in your dictionary? a) print(Info["name"]) b) print(Info["age"]) c) print(Info["gender"])

Clasament

Stilul vizual

Opţiuni

Comutare șablon

Restaurare activitate salvată automat: ?