微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我想建立一个BMI计算器,对编程来说是全新的

如何解决我想建立一个BMI计算器,对编程来说是全新的

对编程来说是全新的。如果我的代码正确,有人可以检查吗?如果是这样,有人可以告诉我如何继续进行下去。这是代码

import tkinter as tk
from tkinter import *
from functools import *

root = Tk()
root.geometry("400x400")
root.title("bmi calculator")
label1 = tk.Label(root,text="please enter your weight in kg").pack()
label2 = tk.Label(root,text="please enter your height in metres").pack()
e1 = tk.Entry(root,height=2,width=30).place(x=30,y=90)
e2 = tk.Entry(root,width=30).place(x=50,y=90)


def calculationtool1(bmi1,bmi2,result1,result2):
bmi1 = (bmi1.get())
bmi2 = (bmi2.get())
result1 = int(bmi2)*int(bmi2)
result2 = bmi1/result1

bmi1 = StringVar()

解决方法

Table<Integer,String,Double> table = HashBasedTable.create();

table.put(1,"a",2.0);
double v = table.get(1,"a"); // getting 2.0

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。