I want to make program to calculate gas prices, but my code gets an error.
from tkinter import *
root = Tk()
ment = StringVar()
root.geometry('450x450+500+300')
root.title('ბენზმთვლელი')
mlabel2 = Label(root, text='რეგულარი >> '+2.23+ 'GEL').pack()
mlabel3 = Label(root , text = 'ევრო რეგულარი >> '+2.29+' GEL').pack()
mlabel4 = Label(root, text="პრემიუმი >> " + 3.35 + " GEL").pack()
mlabel5 = Label(root, text='დიზელი >> ' + 2.25 + ' GEL').pack()
mlabel6 = Label(root, text='ევრო დიზელი >> '+2.33+' GEL').pack()
mlabel1 = Label(root, text="მიუთითეთ ბენზინის რაოდენობა(ლიტრებში)").pack()
mentry1 = Entry().pack()
mlabel7 = Label(root, text="მიუთითეთ ბენზინის დასახელება(ზემოთ ჩამოთვლილთაგან)").pack()
mentry2 = Entry().pack()
def gamotvla():
if mlabel7 == mlabel3 or mlabel2 or mlabel4 or mlabel5 or mlabel6:
print(mlabel1*mlabel7)
else:
print('რაღაც შეიყვანე შეცდომით!!')
mbutton = Button(root, text='გამოთვლა',fg="red",bg='black', command=gamotvla).pack()
root.mainloop()
Error:
Traceback (most recent call last):
File "/home/zura12337/Desktop/Python/Atom/tk.py", line 11, in <module>
mlabel2 = Label(root, text='რეგულარი >> '+2.23+ 'GEL').pack()
TypeError: cannot concatenate 'str' and 'float' objects
Can you help me?