Page 1 of 1
What some 13 year olds told me today.
Posted: Fri Jan 17, 2025 3:34 pm
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 (24.33 KiB) Viewed 230 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 (129.36 KiB) Viewed 230 times
-
No bollo with funny brackets, no bollo; and a lot easier to see what's going on.
Re: What some 13 year olds told me today.
Posted: Fri Jan 17, 2025 3:49 pm
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
Re: What some 13 year olds told me today.
Posted: Fri Jan 17, 2025 6:43 pm
by tperry2x
Depends on how much hand-holding you want it to do, but here's an example with input validation.

- xTalk-out.png (31.28 KiB) Viewed 211 times
Here's the equivalent python script to do the same thing:

- python-out.png (16.54 KiB) Viewed 211 times
Here's a side-by-side comparison. Although the xTalk version might be slightly longer, it's certainly more human-readable:

- comparison.png (71.78 KiB) Viewed 206 times
Re: What some 13 year olds told me today.
Posted: Fri Jan 17, 2025 7:31 pm
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.