Hi there .... I've just joined this list and thought I'd introduce myself. I used to be fairly competent in c but never made the grade to c++. I've done very little programming in the last couple of years or so. I'm getting a Raspberry-pi for our local Junior school and am starting to learn Python so I can show the year five and year six kids how to write simple games. I'm already enjoying this lovely language. One of the few c things I miss is the switch/case statement. if and elif in it's place is a bit cumbersome. Still, it works.

One of the things I wanted to do is to use a four integer array to get four integers returned from a function. I ended up using what I think is a list. (I'm not really sure of the datatypes yet). This is what I did, and it works, but looks very inelegant to me:

correct = 0
    match = 0
    wrong = 0
    results = [correct, match, wrong]

    results = getflag(flag_1, results)
    results = getflag(flag_2, results)
    results = getflag(flag_3, results)
    results = getflag(flag_4, results)

Any thoughts?

Kind regards,        Barry.

--
From Barry Drake - a member of the Ubuntu advertising team

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to