Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65433

Re: Calculator Problem

References <608a3384-525b-4879-82d2-5a6414827fa7@googlegroups.com> <ed1c2ddd-f704-4d58-a5a4-aef13de88817@googlegroups.com>
Date 2014-02-04 10:54 -0500
Subject Re: Calculator Problem
From David Hutto <dwightdhutto@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.6392.1391529261.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Missed that it's already pointed out, was looking at the google groups
combined email.



On Tue, Feb 4, 2014 at 10:43 AM, David Hutto <dwightdhutto@gmail.com> wrote:

> On Sunday, February 2, 2014 4:16:44 PM UTC-5, 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:'))
> >
> >     2 = float(input('Second Number:'))
> >
> >     print('Your Final Result is:', 1 + 2)
> >
> >
> >
> >
> >
> > 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()
>
> Can anyone point out how using an int as a var is possible, unless it's
> something I miss that changed in 3.3 from 3.2:
>
> david@david:~$ python3.2
> Python 3.2.3 (default, Sep 25 2013, 18:25:56)
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 7 = float(input('First Number:'))
>   File "<stdin>", line 1
> SyntaxError: can't assign to literal
> >>>
>
> david@david:~$ python
> Python 2.7.3 (default, Sep 26 2013, 20:08:41)
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 7 = float(input('First Number:'))
>   File "<stdin>", line 1
> SyntaxError: can't assign to literal
> >>>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Best Regards,
David Hutto
*CEO:* *http://www.hitwebdevelopment.com <http://www.hitwebdevelopment.com>*

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Calculator Problem Charlie Winn <charliewinn97@gmail.com> - 2014-02-02 13:16 -0800
  Re: Calculator Problem Alister <alister.ware@ntlworld.com> - 2014-02-02 21:39 +0000
  Re: Calculator Problem Gary Herron <gary.herron@islandtraining.com> - 2014-02-02 13:46 -0800
    Re: Calculator Problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-02 22:11 +0000
    Re: Calculator Problem Charlie Winn <charliewinn97@gmail.com> - 2014-02-03 10:04 -0800
      Re: Calculator Problem Joel Goldstick <joel.goldstick@gmail.com> - 2014-02-03 13:17 -0500
        Re: Calculator Problem Charlie Winn <charliewinn97@gmail.com> - 2014-02-03 10:25 -0800
          Re: Calculator Problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-02-04 00:41 +0000
      Re: Calculator Problem Roy Smith <roy@panix.com> - 2014-02-03 13:26 -0500
      Re: Calculator Problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-03 22:24 +0000
        Re: Calculator Problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-03 16:10 -0700
      Re: Calculator Problem Gary Herron <gary.herron@islandtraining.com> - 2014-02-03 15:06 -0800
  Re: Calculator Problem David Hutto <dwightdhutto@gmail.com> - 2014-02-04 07:43 -0800
    Re: Calculator Problem David Hutto <dwightdhutto@gmail.com> - 2014-02-04 10:54 -0500
    Re: Calculator Problem Roy Smith <roy@panix.com> - 2014-02-04 19:53 -0500
      Re: Calculator Problem Chris Angelico <rosuav@gmail.com> - 2014-02-05 12:09 +1100
      Re: Calculator Problem Dan Sommers <dan@tombstonezero.net> - 2014-02-05 02:22 +0000
        Re: Calculator Problem Joshua Landau <joshua@landau.ws> - 2014-02-05 18:03 +0000
        Re: Calculator Problem Peter Otten <__peter__@web.de> - 2014-02-05 19:15 +0100
  Re: Calculator Problem "Mario R. Osorio" <nimbiotics@gmail.com> - 2014-02-04 14:55 -0800
  Re: Calculator Problem 88888 Dihedral <dihedral88888@gmail.com> - 2014-02-05 10:30 -0800

csiph-web