0
def pl():
        num1=float(ent.get())
        ent.delete(0, END)
        num2=float(ent.get())
        result=sum(num1, num2)
        ent.insert(END, result)

When I want to sum both of the numbers this error happens. It says I cannot convert string number to the float one.

ir1shka
  • 1
  • 1
  • Welcome to Stack Overflow. Please read [ask] and [mre], show code *that someone else could copy and paste to see the problem* (sometimes this means more code, but sometimes it means less), and *ask a question* - beginning with a question word like "why" or "how" and ending with a question mark (`?`). It is also useful to [show complete error messages](https://meta.stackoverflow.com/questions/359146), and to [try to solve the problem yourself first](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/). – Karl Knechtel May 23 '22 at 22:12
  • 1
    `sum()` is for adding the elements of sequences. Just use `num1+num2` to add two numbers. – Barmar May 23 '22 at 22:13
  • That said: in your own words, what do you expect `sum(num1, num2)` to mean? Did you try reading the documentation for `sum`? – Karl Knechtel May 23 '22 at 22:13
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 24 '22 at 01:04

0 Answers0