#:white_check_mark: Python/ Exersim Nº3
40 messages · Page 1 of 1 (latest)
The function first examines the parameter touching_power_pellet:
if touching_power_pellet is True:
return True
else:
return False
If this parameter is True the function returns True.
If this parameter is False the function returns False.
The function ends either way, without executing anything else.
Do you have an idea how to solve this exercise on a conceptual level?
How would you describe the function to a friend, in English?
@hidden mountain You still there?
I still want to help.
How would you describe to a friend when exactly Pac-Man scores?
when it do waka?
sorry I needed to do this jsjsjsjsjsjs
ok the conditional doesn't make sense because if it is True and I tell it to return True it gives me the same result for me it doesn't make sense, I don't know if I'm wrong?
I'm really sorry, I'm sorry, I just realized something, I'm really stupid.
when it do waka?
As far as i know Pac-Man makes "waka" when it moves, even if it does not eat a power pellet or a dot.
if it is True and I tell it to return True it gives me the same result
I'm not sure i understand. Let's try it this way:
The comment in the function tells you what the function should do:
"Pac-Man has scored when a power pellet or dot has been eaten."
The parametertouching_power_pellettells you whether Pac-Man has just eaten a power-pellet,
the parametertouching_dottells you whether Pac-Man has just eaten a dot.
Now you need to returnTrueif any of those things is true.
So you need to translate "when a power pellet or dot has been eaten" to Python.
So should I tell python that Pacman scores regardless of whether touching_power_pellet or touching_dot?
Thanks I solved the problem thanks for not giving me the answer and helping me think
Now another question arises, is it okay for me to use conditionals in this exercise?
yes it is. some programmers prefer if statements over long and complicated expressions.
so choose what you like more.
But is that within good practice when writing in the language?
those are good questions for a code review. after you've submitted a solution you can request one and get a mentoring session with (ideally) more experienced programmer
Now how do I if I have a question with the same exercise, do I edit the post or make a new one?
for the same exercise? either way is fine.
Happy coding, young padawan 🙂
Help I don`t know what was I writte!
rather
I don`t understand what was I writte!
Is there something specific you want help with?
wait!
I've been waiting all week!! I need to wait more?
I was working, sorry! It didn't give me a chance to study anything.
Oh? Am I still supposed to wait? Did you have a question?
It wasn't because I was procrastinating, I was really busy, I still want you to remember my words akiramenai no matter how difficult the exercise is I know I can understand it and overcome it and with your help improve even more
no I solved and understood the exercise thanks for you help and attentions!
If everything is resolved, we ask that the person who posted the request react to the top/original post with a :white_check_mark: (:white_check_mark:). This indicates to others that this issue has been resolved and locks the thread.
If all the tests pass and you want to further improve your solution, we encourage you to use the "Request a Code Review" feature on the website!
thanks
:white_check_mark Python/ Exersim Nº3
:white_check_mark: Python/ Exersim Nº3
react to it, not changing the name
You're supposed to react to the top post
Ahhh ok
