Path: csiph.com!usenet.pasdenom.info!news.albasani.net!rt.uk.eu.org!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'elif': 0.05; 'variables': 0.07; 'string': 0.09; 'subject:Help': 0.11; 'python': 0.11; 'def': 0.12; '"n"': 0.16; '"s"': 0.16; 'etc...': 0.16; 'lower-case': 0.16; 'subject:show': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'things.': 0.19; 'header:User-Agent:1': 0.23; 'questions:': 0.24; 'specify': 0.24; 'string,': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'subject:please': 0.30; '3.x': 0.31; 'subject:next': 0.31; 'maybe': 0.34; 'subject:the': 0.34; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'subject:?': 0.36; 'list': 0.37; 'list.': 0.37; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'tell': 0.60; 'containing': 0.69; 'william': 0.81; '"num":': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=YWoQx4iTpbmpxx5H2+JYbVc+0t9vtz+I/v7Vyh7halI=; b=aAhAfm83G6h3m84m4cOoZqgQBKsl35bIDI44gojUnFgOh2Yul59NM1X6XWEjFocUQf 8me5K8oHwKMFBU28TU2YXwBX381Xvy7u97uRHABdaxdkMmwaO6cmBOd3h57KSc7RzwOJ r4aezz5Er7Vny71pjdsBATz4BOYMQmNCVlhedjDA+My6nYXIe5PYH/RPTLuMBPbpwzhj +kE/goGi/wnvCkgSvrSeeuCnVXbycVA074rDDWgUJJovanxPXue4DOMc/a+NvxDWnHZ8 ypGau2b3znDrOomIZcydkTkjXBSZOoP42Iad259bh8dKNswQ1I0xs6xG49PRHAjPMvgc xUFQ== X-Received: by 10.205.68.137 with SMTP id xy9mr446335bkb.28.1378891924217; Wed, 11 Sep 2013 02:32:04 -0700 (PDT) Date: Wed, 11 Sep 2013 10:32:02 +0100 From: Jugurtha Hadjar User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Help please, why doesn't it show the next input? References: <2dba1d63-16f0-412d-b650-0cdc27c3b57e@googlegroups.com> In-Reply-To: <2dba1d63-16f0-412d-b650-0cdc27c3b57e@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 11 Sep 2013 13:15:22 +0200 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378898124 news.xs4all.nl 15976 [2001:888:2000:d::a6]:59171 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53950 Hello, William On 09/11/2013 06:39 AM, William Bryant wrote: > user_input1 = input(prompt) I take it you are using Python 3.x . If that's not the case, take a look at raw_input(). > def NOS(): > if user_input1 == "String" or user_input1 == "string" or user_input1 == "STRING" or user_input1 == "s" or user_input1 == "S" or user_input1 == "str": > print("a") What if you create a list containing these, and then you check if the user_input is contained in that list. But before that, get the lower-case of it so you don't deal with String sTring string, s, S, etc... Something like this You add this to the variables you are using section string_list = ['string', 's'] When you want to check the check if user_input.lower() in string_list: {your_code_here} > elif user_input1 == "Number" or user_input1 == "number" or user_input1 == "NUMBER" or user_input1 == "N" or user_input1 == "N" or user_input1 == "int" or user_input1 == "num": > print("a") Same goes with that But some questions: 1 - Why does the user have to specify that, why doesn't the program itself tell if it is a string or a number ? You just give it the data and it's up to him to tell. 2 - What is it you are trying to accomplish: Maybe there are shortcuts or better ways to do things. -- ~Jugurtha Hadjar,