【发布时间】:2021-12-04 08:47:34
【问题描述】:
from tkinter import Tk, simpledialog, messagebox
import random
Countries, Capitals = {'Belgium':'Brussels','France':'Paris', 'Germany':'Berlin', 'Italy':'Rome', 'Poland':'Warsaw'}
QueryCountry = simpledialog.askstring("What is the capital of " + )
我想制作一个程序,可以使用 Tkinter 对世界各国的首都进行测验。我想知道您是否可以在字典中使用随机模块。如果是的话,你能帮帮我吗?我是编码初学者,所以请帮忙。
【问题讨论】:
-
这能回答你的问题吗? How to get a random value from dictionary?
标签: python python-3.x dictionary random