Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'syntax': 0.04; 'elif': 0.05; '*not*': 0.07; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'def': 0.12; 'did,': 0.16; 'intended.': 0.16; 'skip:q 30': 0.16; 'subject:Problem': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'hey': 0.18; 'trying': 0.19; 'print': 0.22; 'header:User-Agent:1': 0.23; 'errors.': 0.24; 'received:emailsrvr.com': 0.24; 'sorry,': 0.24; 'guys': 0.24; 'question': 0.24; 'received:(smtp server)': 0.26; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'errors': 0.30; 'program,': 0.31; 'lines': 0.31; '(since': 0.31; 'gary': 0.31; 'run': 0.32; 'running': 0.33; 'display': 0.35; 'one,': 0.35; 'but': 0.35; 'really': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'even': 0.60; 'tell': 0.60; 'full': 0.61; 'first': 0.61; 'times': 0.62; 'claim.': 0.84; 'divide': 0.84; 'happened.': 0.84; 'is)': 0.84; 'nonsense.': 0.84 X-Virus-Scanned: OK Date: Sun, 02 Feb 2014 13:46:24 -0800 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Calculator Problem References: <608a3384-525b-4879-82d2-5a6414827fa7@googlegroups.com> In-Reply-To: <608a3384-525b-4879-82d2-5a6414827fa7@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 70 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391377595 news.xs4all.nl 2835 [2001:888:2000:d::a6]:57342 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65288 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:')) > 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() 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