Help end medical misogyny. Sign our petition.

Help end medical misogyny.
Sign our petition.

Sign the petition

Please or to access all these features

Parenting

For free parenting resources please check out the Early Years Alliance's Family Corner.

Python Coding help - Amazon Young Engineers

8 replies

EasterBuns · 01/05/2020 10:26

So my DS is quite good coding with scratch and I saw Amazon were offering a free course introducing Python. He started off well programming a drone all good. Trouble is as the projects progress he is struggling and there is no help function. Unless you get a question right you cannot move on to the next question so he is stuck.
Is there anyone who can help him with this question. He has had a go but it is rejecting his code.

Python Coding help - Amazon Young Engineers
OP posts:
Are your children’s vaccines up to date?
Sparticle · 01/05/2020 10:27

Step 4, should it be a greater than symbol after the 5?

(I know nothing about coding!)

Sparticle · 01/05/2020 10:28

Or the sign before 7 is the wrong way round - I'm just wondering if they should be different. Does this make any sense? Grin

Fagled · 01/05/2020 10:39

Hi, you're almost there!

On line 4, you need to replace time with get_time().

Alternatively you could do time = get_time() on line 3.

At the moment, the time variable on line 4 hasn't been defined. Likewise, get_time() on line 3 isn't actually doing anything, as nothing is being assigned to the result of the function call.

Interested in this thread?

Then you might like threads about this subject:

EasterBuns · 01/05/2020 10:48

Thank you have deleted line 3 and adjusted line 4 but think we need a repeat function at the end?

OP posts:
Fagled · 01/05/2020 10:52

Without looking at the rest of the exercise and context, I wouldn't have thought repeat() is needed at all.

EasterBuns · 01/05/2020 10:56

Here is the new code which is still not being accepted.

Python Coding help - Amazon Young Engineers
OP posts:
BoomChakaBoom · 02/05/2020 10:39

Try not putting the underscore between gettime(), or you could try declaring a variable such as time = gettime() and putting that there. I don't have experience in the python language though, just c++ and node.js.

MechaStreisand · 02/05/2020 10:45

Should line 3 be something like this?

if gettime() >= 5 and gettime()

New posts on this thread. Refresh page
Swipe left for the next trending thread