[Tutor] input problem ?

Koen Bossers koen@behindthesofa.dhs.org
Thu, 06 Sep 2001 22:22:21 +0200


Walter van den Broek wrote:

>Hi, 
>Complete newbie here.
>>From a lot of patients we get data to obtain a diagnosis.
>To make it easier and more accurate i planned to put the obtained scores
>in a program to verify the diagnoses.
>>From the first two questions at least one has to have a score>4.
>If that is the case from the other 7 questions at least 4 have to score
>higher than four to become diagnosed as being severely depressed.
>I tried the following code to accomplish it, but became slightly
>"depressed"
>At first with the first two questions it worked well, appending the
>other questions delivered error messages
>Traceback (innermost last):
>  File "<string>", line 1, in ?
>SyntaxError: can't assign to operator (dsm4.py, line 10)
>And this is the code:
>import string
>vraag_234 = input ( "Wat is de score bij vraag 234? ")
>vraag_326 = input ("Wat is de score bij vraag 326? ")
>vraag_317-321 = input ("Wat is de score bij vraag 317-321?")
>vraag_272-315 = input ("Wat is de score bij vraag 272-315?")
>vraag_334-343 = input ("Wat is de score bij vraag 334-343?")
>vraag_315 = input ("Wat is de score bij vraag 315?")
>
Change vraag_number-number to vraag_number_number (minus symbol cannot 
be used in keywords!)

Cheers, Koen