Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'elif': 0.05; 'assign': 0.07; 'literal': 0.09; 'python': 0.11; 'def': 0.12; 'missed': 0.12; '2.7.3': 0.16; 'skip:q 30': 0.16; 'subject:Problem': 0.16; 'syntaxerror:': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'hey': 0.18; 'pointed': 0.19; 'possible,': 0.19; 'feb': 0.22; '>>>': 0.22; 'email addr:gmail.com>': 0.22; '>>>': 0.24; 'guys': 0.24; 'question': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'program,': 0.31; '"",': 0.31; 'sep': 0.31; 'anyone': 0.31; 'file': 0.32; 'run': 0.32; 'url:python': 0.33; 'running': 0.33; 'to:name:python-list': 0.33; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'var': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'two': 0.37; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'how': 0.40; 'first': 0.61; 'more': 0.64; 'miss': 0.74; '10:43': 0.84; 'divide': 0.84; '2013,': 0.91; '<>*': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ueN4lNu5KuGbG2FQd1S8uji8DUbdODqIZMkNDm+tAU0=; b=nIqmwo6PuId0To7s4yHbSNeQjEKhZ5e/KspTLvzTStdnKSk/9OK7ysjMHjShCDLDvu v7uBJBd9TFbWNOpFtLjDOn4CbjMYUFmwHPWlK67IycIt87TiDQcjsKqm7hARRdvHKebU 4bNAZxofbrIHUmQwS8WcypY+pOhgVw9Rh4Gpu75S+CmHdTIcvPwLgo2XoK4CPc/ntZSC 7WcrUagSNTlELkL2lM+Ml/6i2mrVDJzF0gC+c6MWcSJdWvf2Zo1pUKXxNvgD8lJKRIrf sTcnI5G8gnibVri7Ihz1qC+JgCByrPrhl4PewsbgiP5fs+r+GtMpn9OZPgD0jHdZp04P Lmow== MIME-Version: 1.0 X-Received: by 10.140.82.8 with SMTP id g8mr64404244qgd.88.1391529256897; Tue, 04 Feb 2014 07:54:16 -0800 (PST) In-Reply-To: References: <608a3384-525b-4879-82d2-5a6414827fa7@googlegroups.com> Date: Tue, 4 Feb 2014 10:54:16 -0500 Subject: Re: Calculator Problem From: David Hutto To: python-list Content-Type: multipart/alternative; boundary=001a11c119820d523104f196a7f8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 290 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391529262 news.xs4all.nl 2858 [2001:888:2000:d::a6]:55235 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65433 --001a11c119820d523104f196a7f8 Content-Type: text/plain; charset=ISO-8859-1 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 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 "", 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 "", 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 * --001a11c119820d523104f196a7f8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Missed that it's already pointed out, was looking at t= he google groups combined email.


On Tue, Feb 4, 2014 at 10:43 AM, David Hut= to <dwightdhutto@gmail.com> wrote:
On Sunday, February 2, 201= 4 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():
>
> =A0 =A0 print('Addition: What are two your numbers?')
>
> =A0 =A0 1 =3D float(input('First Number:'))
>
> =A0 =A0 2 =3D float(input('Second Number:&= #39;))
>
> =A0 =A0 print('Your Final Result is:', 1 + 2)
>
>
>
>
>
> def Subtraction():
>
> =A0 =A0 print('Subtraction: What are two your numbers?')
>
> =A0 =A0 3 =3D float(input('First Number:'))
>
> =A0 =A0 4 =3D float(input('Second Number:&= #39;))
>
> =A0 =A0 print('Your Final Result is:', 3 - 4)
>
>
>
>
>
> def Multiplication():
>
> =A0 =A0 print('Multiplication: What are two your numbers?= 9;)
>
> =A0 =A0 5 =3D float(input('First Number:'))
>
> =A0 =A0 6 =3D float(input('Second Number:&= #39;))
>
> =A0 =A0 print('Your Final Result is:', 5 * 6)
>
>
>
>
>
> def Division():
>
> =A0 =A0 print('Division: What are your two numbers?')
>
> =A0 =A0 7 =3D float(input('First Number:&#= 39;))
>
> =A0 =A0 8 =3D float(input('Second Number:&= #39;))
>
> =A0 =A0 print('Your Final Result is:', 7 / 8)
>
>
>
>
>
>
>
> print('What type of calculation would you like to do?')
>
> Question =3D input('(Add, Subtract, Divide or Multiply)')
>
> if Question.lower().startswith('a'):
>
> =A0 =A0 =A0 =A0 =A0 =A0 print(Addition())
>
> elif Question.lower().startswith('s'):
>
> =A0 =A0 =A0 =A0 =A0 =A0 print(Subtraction())
>
> elif Question.lower().startswith('d'):
>
> =A0 =A0 =A0 =A0 =A0 =A0 print(Division())
>
> elif Question.lower().startswith('m'):
>
> =A0 =A0 =A0 =A0 =A0 =A0 print(Multiplication())
>
> else:
>
> =A0 =A0 =A0 =A0 print('Please Enter The First Letter Of The Type O= f Calculation You Would Like To Use')
>
>
>
> while Question =3D=3D 'test':
>
> =A0 =A0 =A0 =A0 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 =3D float(input('First Number:'))<= br>
=A0 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 =3D float(input('First Number:&= #39;))
=A0 File "<stdin>", line 1
SyntaxError: can't assign= to literal
>>>

--
https://mail.python.org/mailman/listinfo/python-list



--
Best Rega= rds,
David Hutto<= /span>
CEO: http://www.hitwebdevelopment.com
--001a11c119820d523104f196a7f8--