I am currently trying to multiply a number from a list with a number from a text file however I get the error=
Can't multiply sequence by non-int of type 'NonType'
text_file =open("read_it.txt", "r")
price1 = pricetxt*(items2)
print() returns None and you are preserving it in
pricetxt(). Also you need to convert the result which is a string to
int (if it's a correct data). Also note that you better to use a
with statement for opening the file, because it will close the file automatically at the end of the block.
with open("read_it.txt") as text_file: try: price = int(text_file.readlines()) except ValueError: # do something else else: new_price = price * items2
Note that also
items2 needs to be integer. If it's not you have to convert it to integer, which you can do it in
try block after