[Tutor] input problem
Alex Hall
mehgcap at gmail.com
Sun Aug 22 20:49:03 CEST 2010
On 8/22/10, Roelof Wobben <rwobben at hotmail.com> 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 must be counted: ")
> x=count_letters (fruit,letter)
> print "De letter", letter , "komt", x , "maal voor in het woord", fruit
>
>
>
> The problem is that I can't have the opportuntity for input anything.
Try replacing the two lines where you say "input" with "raw_input" and
see if that works.
>
> I use python 2.7 on a Win7 machine with as editor SPE.
>
>
>
> Roelof
>
>
>
--
Have a great day,
Alex (msg sent from GMail website)
mehgcap at gmail.com; http://www.facebook.com/mehgcap
More information about the Tutor
mailing list