https://friendpaste.com/mTdjXilQ0bVQJpsoCu1Wf

i am having the error (float' object has no attribute 'insert').I am getting the same error with append. any solutions??? I am using python 3.4.2 .Thanks in advance.

Recommended Answers

You probably mean Total.insert() instead of total.insert().

Edit: Note that your global statements are unnecessary. global x is only necessary in a function if the function contains a line x = ... and x is a global variable. If you want to use a global variable without setting its value, …

Jump to Post

All 3 Replies

You probably mean Total.insert() instead of total.insert().

Edit: Note that your global statements are unnecessary. global x is only necessary in a function if the function contains a line x = ... and x is a global variable. If you want to use a global variable without setting its value, you don't need global.

i tried it but the same error occurs

Then can you post the whole new code in this thread ? Use the Code button in the editor to paste your code in a popup window. Also can you post the full error traceback sent by python ? Again use the Code button. The exception traceback tells you precisely where there is an error in your code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.