The programme keeps saying that it cant multiply by a non-int 'str'

6 views
Skip to first unread message

abb...@centralfoundationboys.co.uk

unread,
Oct 13, 2015, 5:38:17 AM10/13/15
to Interactive Editor for Python
import time

print (“only print numbers as your answers”)

time.sleep(2)

answer = input (“enter the height of the room walls”)

Q1 = input(“enter length of room walls between 2 to six metres”)

While answer = range(2,6):

Q1

Q2 = input(“enter the price of paint that you want. Luxury = 1.75. Standard cost 1. Economy = 0.45.”)

While q1 = range(1,25):

Q2

print answer * Q1 * Q2



Eelke Spaak

unread,
Oct 13, 2015, 5:44:54 AM10/13/15
to ie...@googlegroups.com
I would not consider this an IEP-specific problem, but more a general
Python question. You might be better off posting it at
stackoverflow.com or something similar.

A hint: use int('123') to convert strings to ints, or float('1.23') for floats.

Good luck,
Eelke
> --
> You received this message because you are subscribed to the Google Groups
> "Interactive Editor for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iep_+uns...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages