Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Python : TypeError: can't multiply sequence by non-int of type 'float'

Asked by Ankur Vaish Apr 14, 2021 1.3K views 1 answer
Share

About this question

I am a newbie programmer trying to make an IRC bot that parse XML and paste its content on a channel. Usually, I find my answer on google, but this time I can't find my answer.


q0tag = dom.getElementsByTagName('hit')[0].toxml() 


q0 = q0tag.replace('','').replace('','') 


q1 = (q0 * 1.2)


when I'm trying to multiply q0 it always showing


TypeError: can't multiply sequence by non-int of type 'float'.


I'm trying to make q0 int or float but it just makes another error


AttributeError: 'NoneType' object has no attribute 'replace'

q0 value is a round number without a decimal.

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.