Re: [Tutor] input problem

2010-09-14 Thread Alan Gauld
"ANKUR AGGARWAL" wrote Suppose i am taking input or various variables like a=raw_input("...") //hello b=raw_input("")//hi but i want to run a common function when input is hello so instead of if a=="hello": fun() then again for b and then again for c then d and so

Re: [Tutor] input problem

2010-09-13 Thread James Mills
On Tue, Sep 14, 2010 at 6:45 AM, ANKUR AGGARWAL wrote: > Suppose i am taking input or various variables like > a=raw_input("...") //hello > b=raw_input("")//hi > c=raw_input("...")//hello > d=raw_input("..")//hello > but i want to run a common functi

Re: [Tutor] input problem

2010-09-13 Thread christopher . henk
ANKUR AGGARWAL wrote on 09/13/2010 04:45:41 PM: > Suppose i am taking input or various variables like > a=raw_input("...") //hello > b=raw_input("")//hi > c=raw_input("...")//hello > d=raw_input("..")//hello > but i want to run a common function when

[Tutor] input problem

2010-09-13 Thread ANKUR AGGARWAL
Suppose i am taking input or various variables like a=raw_input("...") //hello b=raw_input("")//hi c=raw_input("...")//hello d=raw_input("..")//hello but i want to run a common function when input is hello so instead of if a=="hello": fun() then aga

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
Please try and reply to the list instead of just me. raw_input did not the trick. fruit.count is the next exercise. Oke, I deleted the initialazion and change teller into letter. Roelof Should be alright now.. Hmmm Can you paste your exact code AND the error you're getting? As I understand

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
On 08/22/2010 09:35 PM, Roelof Wobben wrote: Hello, I made this programm : def count_letters(n,a): count = 0 for char in n: if char == a: count += 1 return count fruit="" letter="" fruit= input("Enter a sort of fruit: ") teller = input("Enter the character which

Re: [Tutor] input problem

2010-08-22 Thread Alex Hall
On 8/22/10, Roelof Wobben wrote: > > Hello, > > > > I made this programm : > > > > def count_letters(n,a): > count = 0 > for char in n: > if char == a: > count += 1 > return count > > fruit="" > letter="" > fruit= input("Enter a sort of fruit: ") > teller = input("E

Re: [Tutor] input problem

2010-08-22 Thread Nick Raptis
On 08/22/2010 09:35 PM, Roelof Wobben wrote: Hello, I made this programm : def count_letters(n,a): count = 0 for char in n: if char == a: count += 1 return count fruit="" letter="" fruit= input("Enter a sort of fruit: ") teller = input("Enter the character which

[Tutor] input problem

2010-08-22 Thread Roelof Wobben
Hello, I made this programm : def count_letters(n,a): count = 0 for char in n: if char == a: count += 1 return count fruit="" letter="" fruit= input("Enter a sort of fruit: ") teller = input("Enter the character which must be counted: ") x=count_letters (f