[Tutor] How to make def where arguments are either stated when called or entered via raw_input

2012-02-09 Thread David Craig
Hi, I'm trying to write a function that will either take arguments when the function is called, such as myFunc(x,y,z) or if the user does not enter any arguments, myFunc() the raw_input function will ask for them. But I dont know how to check how many arguments have been entered. My code is

Re: [Tutor] How to make def where arguments are either stated when called or entered via raw_input

2012-02-09 Thread Steven D'Aprano
David Craig wrote: Hi, I'm trying to write a function that will either take arguments when the function is called, such as myFunc(x,y,z) or if the user does not enter any arguments, myFunc() the raw_input function will ask for them. But I dont know how to check how many arguments have been

Re: [Tutor] How to make def where arguments are either stated when called or entered via raw_input

2012-02-09 Thread Peter Otten
David Craig wrote: I'm trying to write a function that will either take arguments when the function is called, such as myFunc(x,y,z) or if the user does not enter any arguments, myFunc() the raw_input function will ask for them. But I dont know how to check how many arguments have been

Re: [Tutor] How to make def where arguments are either stated when called or entered via raw_input

2012-02-09 Thread Brian van den Broek
On 9 Feb 2012 13:34, David Craig dcdavem...@gmail.com wrote: Hi, I'm trying to write a function that will either take arguments when the function is called, such as myFunc(x,y,z) or if the user does not enter any arguments, myFunc() the raw_input function will ask for them. But I dont know how