+ 1
Can someone please help explain "THAT ODD" code coach
I've been trying to solve these code coach buy I'm guessing that my interpretation to the question is wrong cause I've tried several means and still I've not been able to solve it... Here's my recent approach user = int(input()) test = user + 1 output = 0 for i in range (test): if i % 2 == 0: output += i print (output) My code works fine on my ide but solo learn keeps saying I'm wrong 😔
8 Antworten
+ 2
thank you FF9900
my new code now is:
user = int(input())
test = user + 1
output = 0
for i in range (test):
user_values = int(input())
if user_values % 2 == 0:
output += user_values
print (output)
but the peoblem now is i'm greeted with an end of file(eof) error
+ 2
FF9900 thanks buddy for your time and effort....I've gotten it and it still keeps me to yet wanna ask another question
I commented out the line that says test and get to notice that the range function actually acted strange cause it reached the signified numbered instead of leaving the last number.
Any explanation to this
+ 1
FF9900 ok then, gimme a minute
+ 1
FF9900 funny me.....I forgot that range starts it count from 0, thanks for the reminder and once again thanks for your time and effort
0
FF9900 that was a mistake....i've re-edited it
0
FF9900 this is the same explanation i gave while writing the code but after clicking on result i see a whole bunch of red and i don't know why
0
FF9900 so sorry to stress you out, I don't really understand this
0
FF9900 ok, lemme try again and get back to you