when I try to multiply with a decimal number in python with the input this is what i get
MathCheats Times-Ed by jtl999 Not for decimal numbers due to a bug in the code. Enter first number: 1.2 Traceback (most recent call last): File "Timesed.py", line 18, in <module> numberx1 = (int)(raw_input('Enter first number: ')) ValueError: invalid literal for int() with base 10: '1.2' here is the code #!/usr/bin/python # MathCheats Times-Ed by jtl999 # (C) 2010 jtl999 # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # The GPL is in the file COPYING print ("MathCheats Times-Ed by jtl999") print ("Not for decimal numbers due to a bug in the code.") numberx1 = (int)(raw_input('Enter first number: ')) numberx2 = (int)(raw_input('Enter second number: ')) print ("The answer was") print numberx1*numberx2 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor