-1
Well I need to do this multiplication but give the following error:
Traceback (most recent call last):
File "C:\Users\Guilherme\Desktop\dasdsa.py", line 17, in <module>
conta = (trans1) * trans2
TypeError: can't multiply sequence by non-int of type 'tuple'
What do I do? Do I need a type of variable that does the multiplication with comma? because I tried to put in float but it still didn’t work, I couldn’t convert the trans1 to float, what my options?
MY CODE:
import urllib.request
page = urllib.request.urlopen("http://dolarhoje.com/")
text = page.read().decode("utf8")
price = text[9938:9942]
trans1 = (price)
tuple(price)
usertap = input("Coloque o real aqui:")
trans2 = tuple(usertap)
conta = (trans1) * trans2
print(conta)
BTW, has a line with a
tuple(price)
alone that does nothing. The title of your question could also be more specific.– hugomg