• Register
0 votes

Problem :

I'm new to python and I've been struggling with this problem for a while. I've search google and youtube but no luck so far. I've written this in IDLE 2.6.5. If someone could tell me why I'm getting the can't multiply sequence by non-int of type float error.
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes


The can't multiply sequence by non-int of type 'float' error was because the input taken in the text-box is a string. 

#c = self.input.GetValue()#

the value is still a string. Therefore, that value in c has to be converted, in this case to a float type:

#c = float(c)#

so Python can process it as part of the equation:
#c = 9.0/5.0 * c + 32#

Further Readings:


9 7 4
38,600 points

Related questions

0 votes
1 answer 13 views
Problem: I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount). I run into this error. Anyone know what could be wrong or have any suggestions?
asked Feb 14 Mashhoodch 9.1k points
0 votes
2 answers 277 views
Problem : While submitting the Python program i am getting below error python can't multiply sequence by non-int of type 'float'
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 3 views
typeerror: can't multiply sequence by non-int of type 'float'
asked Feb 16 ArifulIslam 7.5k points
0 votes
1 answer 22 views
Problem: Hi! I am new to the world of programming. I am trying to multiply two numbers that will be entered by the user. I wrote the following program: number1 = input("Enter first number: ") number2 = input("Enter second number: ") print(number1," * ",number2," = ", ... = ",number1*number2) TypeError: can't multiply sequence by non-int of type 'str' I have no idea what I am doing wrong. Any help?
asked Dec 21, 2020 Code Learner 5.6k points
0 votes
1 answer 19 views
Problem: While strings can be multiplied by integers to create a repeating sequence, strings cannot be multiplied by floats. Otherwise, Java returns an error.I was going to talk about the “typeerror: can t multiply sequence by non-int of type ‘float’” error and why it is raised. We’ll walk through an example scenario with this error present so that how can i solve it.
asked Dec 2, 2020 Mashhoodch 9.1k points
0 votes
1 answer 9 views
Problem: I am trying to evaluate a formula, np is numpy: Ds = pow(10,5) D = np.linspace(0, pow(10,6), 100) alpha=1.44 beta=0.44 A=alpha*(D/Ds) L=1.65 buf2=L/4.343 buf=pow(-(alpha*[D/Ds]),beta) value=exp(buf) and then I will plot this data but I get: buf=pow(-(alpha*[D/Ds]),beta) TypeError: can't multiply sequence by non-int of type 'float' How can I overcome this?
asked Feb 17 Mashhoodch 9.1k points
0 votes
1 answer 17 views
Problem: Hi there! I have been working in Python for a while. I am trying to run following program: value = 4.0 for val in value: number = float(input("Enter a number: ")) if number == 0: print("Zero") elif number > 0: print("Positive") elif ... understand what is causing this error. I want to take input from user unless val becomes 4. Could anyone from here please help me solve this error?
asked Jan 15 Code Learner 5.6k points
0 votes
1 answer 93 views
1 vote
1 answer 315 views
Problem: Hello all, I am trying to play with python and completed writing a code. My codes are supposed to create a new note. Unfortunately, I messed up something in the script and it’s not working as I expected. Find my sample script snippet below and have a look ... . So, in the end I am posting here to get responses from you guys. Thanks for your valuable time. I must recognize your help.
asked Apr 26, 2020 Gavin 15.3k points
0 votes
0 answers 18 views
Using pip install for any module apparently on my Ubuntu 16.04 system with python 2.7.11+ throws this error: TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' What is wrong with pip? How could I reinstall it, if necessary? Update: Full traceback is below ... File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment total -= 1
asked Oct 24, 2020 psandprop 2.4k points