This one line is more than enough to cause the problem:
text="რეგულარი >> "+2.23+ 'GEL'
2.23
is a floating-point value; 'GEL'
is a string. What does it mean to add an arithmetic value and a string of letters?
If you want the string label 'რეგულარი >> 2.23 GEL'
, then write it just that way. If you want to construct it from the parts, then convert the value to string:
text="რეგულარი >> " + str(2.23) + 'GEL'
Let’s look at the line in question, and identify a few problems with it.
Here is the line:
mlabel2 = Label(root, text="რეგულარი >> "+2.23+ 'GEL').pack()
You are concatenating a string, a float, and another string. Easiest way to get around this is with some string format expression, like
mlabel2 = Label(root, text="რეგულარი >> {num} GEL".format(num=2.23))
That would be a good solution for Python 3 code… Note that {num}
is a formatting command that gets replaced with your float. There are other ways to handle this, but since you’re using Python 3, I would go with that one. Plus since that number changes in your different Labels, I kept it separate so it’s easy to work with.
Also, keep in mind that your mlabel2 is going to be None in your code, because of the .pack()
command, which returns None. If you want to preserve mlabel2, you have to break the statement up into two…
mlabel2 = Label(root, .... GEL')
mlabel2.pack()
This is the same for most all of your widgets, including the Label’s, Entry’s, and Button. The if
statement in your def gamotvla():
is also going to cause you problems, but let’s start with these.