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:
-
-
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:
-
-
No bollo with funny brackets, no bollo; and a lot easier to see what's going on.
What some 13 year olds told me today.
Forum rules
Be kind.
Be kind.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
What some 13 year olds told me today.
https://richmondmathewson.owlstown.net/
- 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.
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:
However, it's easy in python too:
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
Code: Select all
num = 4
print(is_even(num)) # Output: True
print(is_odd(num)) # Output: False
- 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.
Depends on how much hand-holding you want it to do, but here's an example with input validation.
Here's the equivalent python script to do the same thing:
Here's a side-by-side comparison. Although the xTalk version might be slightly longer, it's certainly more human-readable:
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: What some 13 year olds told me today.
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.
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/
Who is online
Users browsing this forum: No registered users and 2 guests