Calculator Problem

Charlie Winn charliewinn97 at gmail.com
Mon Feb 3 19:25:37 CET 2014


On Monday, February 3, 2014 6:17:44 PM UTC, Joel Goldstick wrote:
> On Feb 3, 2014 1:05 PM, "Charlie Winn" <charli... at gmail.com> wrote:
> 
> >
> 
> > On Sunday, February 2, 2014 9:46:24 PM UTC, Gary Herron wrote:
> 
> > > On 02/02/2014 01:16 PM, Charlie Winn wrote:
> 
> > >
> 
> > > > Hey Guys i Need Help , When i run this program i get the 'None' Under the program, see what i mean by just running it , can someone help me fix this
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > def Addition():
> 
> > >
> 
> > > >      print('Addition: What are two your numbers?')
> 
> > >
> 
> > > >      1 = float(input('First Number:'))
> 
> You can't name a variable a number
> 
> > >
> 
> > > >      2 = float(input('Second Number:'))
> 
> > >
> 
> > > >      print('Your Final Result is:', 1 + 2)
> 
> You should a result, then print it after the function.
> 
> > > >
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > def Subtraction():
> 
> > >
> 
> > > >      print('Subtraction: What are two your numbers?')
> 
> > >
> 
> > > >      3 = float(input('First Number:'))
> 
> > >
> 
> > > >      4 = float(input('Second Number:'))
> 
> > >
> 
> > > >      print('Your Final Result is:', 3 - 4)
> 
> > >
> 
> > > >
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > def Multiplication():
> 
> > >
> 
> > > >      print('Multiplication: What are two your numbers?')
> 
> > >
> 
> > > >      5 = float(input('First Number:'))
> 
> > >
> 
> > > >      6 = float(input('Second Number:'))
> 
> > >
> 
> > > >      print('Your Final Result is:', 5 * 6)
> 
> > >
> 
> > > >
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > def Division():
> 
> > >
> 
> > > >      print('Division: What are your two numbers?')
> 
> > >
> 
> > > >      7 = float(input('First Number:'))
> 
> > >
> 
> > > >      8 = float(input('Second Number:'))
> 
> > >
> 
> > > >      print('Your Final Result is:', 7 / 8)
> 
> > >
> 
> > > >
> 
> > >
> 
> > > >
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > print('What type of calculation would you like to do?')
> 
> > >
> 
> > > > Question = input('(Add, Subtract, Divide or Multiply)')
> 
> > >
> 
> > > > if Question.lower().startswith('a'):
> 
> > >
> 
> > > >              print(Addition())
> 
> > >
> 
> > > > elif Question.lower().startswith('s'):
> 
> > >
> 
> > > >              print(Subtraction())
> 
> > >
> 
> > > > elif Question.lower().startswith('d'):
> 
> > >
> 
> > > >              print(Division())
> 
> > >
> 
> > > > elif Question.lower().startswith('m'):
> 
> > >
> 
> > > >              print(Multiplication())
> 
> > >
> 
> > > > else:
> 
> > >
> 
> > > >          print('Please Enter The First Letter Of The Type Of Calculation You Would Like To Use')
> 
> > >
> 
> > > >
> 
> > >
> 
> > > > while Question == 'test':
> 
> > >
> 
> > > >          Question()
> 
> > >
> 
> > >
> 
> > >
> 
> > > Sorry, but in fact you did *not* run this program as you claim. It's
> 
> > >
> 
> > > full of syntax errors.  Any attempt to run it will display syntax errors
> 
> > >
> 
> > > immediately, and never actually run.   So please tell us what really
> 
> > >
> 
> > > happened.
> 
> > >
> 
> > >
> 
> > >
> 
> > > But even without an accurate description of what you did, I can say this:
> 
> > >
> 
> > >
> 
> > >
> 
> > > Lines like
> 
> > >
> 
> > >      1 = float(...)
> 
> > >
> 
> > > don't make sense.  It's as if you are trying to change the value of the
> 
> > >
> 
> > > number one, but that's nonsense.
> 
> > >
> 
> > >
> 
> > >
> 
> > > And lines like
> 
> > >
> 
> > >      print('Your Final Result is:', 5 * 6)
> 
> > >
> 
> > > had better print out 30 (since that is what 5 times 6 is) but that's
> 
> > >
> 
> > > clearly not what you intended.
> 
> > >
> 
> > >
> 
> > >
> 
> > > Gary Herron
> 
> >
> 
> > excuse me but don't be so ******* rude , i did run this program and it did run correctly and if you want me to prove it with screenshots so be it , so don't make accusations ** Gary ** i only came here for some help not to be accused of not even running my program
> 
> 
> If you can run this, cut and paste the results 
> 
> >
> 
> > Charlie :D
> 
> > --
> 
> > https://mail.python.org/mailman/listinfo/python-list

Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>> 
What type of calculation would you like to do?
(Add, Subtract, Divide or Multiply)a
Addition: What are two your numbers?
First Number:5
Second Number:96
Your Final Result is: 101.0
None
>>>



More information about the Python-list mailing list