Re: - Requesting Comments for Process Definition and Presentation
i too am none the wiser after looking at your site: "Status The services are available for initial Reference Customers. Preferred Domains: Software-Development-Systems. Preferred Projects: Open Source. Profile Lazaridis ReEngineering is a lightweight startup which has developed a System Reengineering Method, based on the pragmatically defined Independent Efficiency Management Process. The provided services apply the Method remotely to different Systems, with a specialization on Software Production Systems like e.g. Large Scale Open-Source Projects or Software Companies". The flowchart reveals nothing either. -- http://mail.python.org/mailman/listinfo/python-list
Beginner trying to understand functions.
In my attempt to learn Python I'm writing a small (useless) program to help me understand the various concepts. I'm going to add to this as I learn to serve as a single place to see how something works, hopefully. Here is the first approach: name = input('Please enter your name: ') print('Hello', name) while True: try: age = int(input('Please enter your age: ')) break except ValueError: print('That was not a valid number. Please try again.') permitted = list(range(18, 31)) if age in permitted: print('Come on in!') elif age < min(permitted): print('Sorry, too young.') elif age > max(permitted): print('Sorry, too old.') input('Press any key to exit.') That works fine. Then I've tried to use functions instead. The first two work fine, the third fails: def getName(): name = input('Please enter your name: ') print('Hello', name) def getAge(): while True: try: age = int(input('Please enter your age: ')) break except ValueError: print('That was not a valid number. Please try again.') def checkAge(): permitted = list(range(18, 31)) if age in permitted: print('Come on in!') elif age < min(permitted): print('Sorry, too young.') elif age > max(permitted): print('Sorry, too old.') getName() getAge() checkAge() I get this error message: NameError: global name 'age' is not defined. I'm stuck, can someone help? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Beginner trying to understand functions.
Thanks for the many replies. Thanks especially to Pierre. This works perfectly: def getName(): name = input('Please enter your name: ') print('Hello', name) def getAge(): while True: try: age = int(input('Please enter your age: ')) return age except ValueError: print('That was not a valid number. Please try again.') def checkAge(age,min=18,max=31): if age in list(range(min, max)): print('Come on in!') elif age < min: print('Sorry, too young.') elif age >= max: print('Sorry, too old.') getName() a = getAge() checkAge(a) I am running Python 3, sorry for not stating that originally. -- http://mail.python.org/mailman/listinfo/python-list
Re: Beginner trying to understand functions.
Thanks for the extra tips Ivan and Bruno. Here is how the program looks now. Any problems? import sys def get_name(): name = input('Please enter your name: ') print('Hello', name) def get_age(): try: return int(input('Please enter your age: ')) except ValueError: print('That was not a valid number. Please try again.') return get_age() def check_age(age,min=18,max=31): if age < min: print('Sorry, too young.') elif age >= max: print('Sorry, too old.') else: print('Come on in!') def again(): response = input('Try again? Y or N: ') while response != "Y": if response == 'N': print('Program finished.') input('Press any key to exit.') sys.exit() else: return response run() def run(): get_name() a = get_age() check_age(a) again() run() -- http://mail.python.org/mailman/listinfo/python-list
#python IRC help - my internet provider is banned!
Hi. Not sure if anyone can help here, but I'm trying to access #python and have found out that my ISP has a blanket ban (for some reason). Does anyone know how I can contact an operator to join? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: #python IRC help - my internet provider is banned!
On Jan 7, 6:30 pm, "Mildew Spores" wrote: > What? Sounds a bit unlikely unless its Virgin.. > I'd imagine it might be that your isp needs to get itself off a black list. > Brian > > -- > My Hotmail Account > mildew_spo...@hotmail.com > > "simonh" wrote in message > > news:fd0bd7d3-ad1d-43c2-b8e5-642a95c21...@t26g2000prh.googlegroups.com... > > > Hi. Not sure if anyone can help here, but I'm trying to access #python > > and have found out that my ISP has a blanket ban (for some reason). > > Does anyone know how I can contact an operator to join? Thanks. > > ISP is bethere and client is Chatzilla. -- http://mail.python.org/mailman/listinfo/python-list