I am getting ValueError: could not convert string to float. Can anyone please edit this?

83
February 10, 2019, at 3:40 PM

I am trying this but I am having this constant error Error: could not convert string to float. I searched and couldn't find a solution to this. I don t know where I went wrong. The value from the user which we are trying to get is the problem always. Anyone please help?

nn1 = 0
nn2 = 0
n = 0 
from tkinter import *
root = Tk()
root.title("Rectangles")
def get_ab(event):
    global nn1
    global nn2
    global n

    nn1 = float(nn1Entry.get())
    nn2 = float(nn2Entry.get())
    n = int(n3Entry.get())

button1 = Button(text="Submit")
button1.grid(column=1,row=3)
button1.bind("<Button-1>", get_ab)
label_1 = Label(root, text="Size Of Sheet")
nn1Entry = Entry(root)
nn2Entry = Entry(root)
label_1.grid(row=0, sticky=E)
nn1Entry.grid(row=0, column=1)
nn2Entry.grid(row=1, column=1)
label_2 = Label(root, text="Number of rectangles")
label_2.grid(row=2)
n3Entry = Entry(root)
n3Entry.grid(row=2,column=1)
root.mainloop()
k = n
for i in range(1,k*2+1):
     globals()['b%s' % i]=0
window = Tk()
window.title("Sizes of rectangles")
for i in range(1, k*2+1):
    nEntry = Entry(window)
    nEntry.grid(row=1, column=1)
    a = float(nEntry.get()) #Errorline is this one
    globals()['b%s' % i] = a
window.mainloop()
print(b1)

Error line is indicated

READ ALSO
Error regarding shapes not aligned back propagation

Error regarding shapes not aligned back propagation

I am a newbie to machine learning and currently learning through Michael Nielsen's website

76
Fullpage.js doesn&#39;t scroll in any browser (chrome, firefox, edge)

Fullpage.js doesn't scroll in any browser (chrome, firefox, edge)

I've been trying to make a really simple website using fullpagejs but it just won't scroll a whole section like its supposed to

86
Unknown URL: content://media/external/audio/media/null?

Unknown URL: content://media/external/audio/media/null?

I am creating a mp3player where all audio files are fetched from the local device storageI show the items in a ListView

62
Static Methods in Private class

Static Methods in Private class

I have recently started learning java and its my first OOP languageI read that static methods do not require the class to instantiated they run when you feed the class to the JVM

40