What some 13 year olds told me today.

All flavors welcome.
Forum rules
Be kind.
Post Reply
User avatar
richmond62
Posts: 4833
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

What some 13 year olds told me today.

Post by richmond62 »

They were told by their programming teacher to write a program in PYTHON to take an input number and determine if it were odd or even.

The teacher gave them NO help: probably because the teacher does NOT know PYTHON (random governmental educational decrees).

No a single child in a class of 28 could od this: and nor could I, so cheated:
-
SShot 2025-01-17 at 17.31.26.png
SShot 2025-01-17 at 17.31.26.png (24.33 KiB) Viewed 233 times
-
But, then, I have never done anything with PYTHON.

Those 'format' things made me think, oddly enough of learning FORTRAN IV when I was 13 (almost exactly 50 years ago), and 'print' as in 'print to screen' similarly.

HOWEVER, I put the equivalent program together on OXT Lite in about 5 minutes:
-
SShot 2025-01-17 at 17.34.01.png
SShot 2025-01-17 at 17.34.01.png (129.36 KiB) Viewed 233 times
-
No bollo with funny brackets, no bollo; and a lot easier to see what's going on.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 3210
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: What some 13 year olds told me today.

Post by tperry2x »

Yes, I know. Things like this are great examples of where the xTalk language is much more readable.
I'd have probably just divided by 2 and checked to see if it contains ".", then I'd know if it were odd or even.

As in:

Code: Select all

Put 35 into mynum 
If mynum /2 contains "." then put false into isEven
However, it's easy in python too:

Code: Select all

num = 4
print(is_even(num))  # Output: True
print(is_odd(num))   # Output: False
User avatar
tperry2x
Posts: 3210
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: What some 13 year olds told me today.

Post by tperry2x »

Depends on how much hand-holding you want it to do, but here's an example with input validation.
odd-or-even.oxtstack
(1.17 KiB) Downloaded 6 times
xTalk-out.png
xTalk-out.png (31.28 KiB) Viewed 214 times
Here's the equivalent python script to do the same thing:
odd-or-even.py.zip
(388 Bytes) Downloaded 5 times
python-out.png
python-out.png (16.54 KiB) Viewed 214 times
Here's a side-by-side comparison. Although the xTalk version might be slightly longer, it's certainly more human-readable:
comparison.png
comparison.png (71.78 KiB) Viewed 209 times
User avatar
richmond62
Posts: 4833
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: What some 13 year olds told me today.

Post by richmond62 »

Some of the problem was the teacher who did not realise that most of the children in her class did not understand:

1. The English for Цяло число is INTEGER.

2. That in PYTHON the term for integer is 'int'.

BUT the plain and simple fact is that the Bulgarian government do NOT have a trained cadre of programming teachers who are familiar with Python (OK, they don'y have a trained cadre of programming teachers at all): but have just told Maths teachers to teach Python.

Now the average Bulgarian school teacher is like school teachers anyway: after a long week trying to control 28 teenage monkeys with raging hormones climbing up the walls with adolescent angst, the last thing they feel inclined to do at the weekend is some home-grown professional development (it certainly won't be offered by one of the most corrupt governments in what is coyly called 'the civilised world'): and it is hard to blame them.

Were (nifty subjunctive there) OXT or 'somesuch' to be adopted life would get better both for teachers and pupils.
https://richmondmathewson.owlstown.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests