0
Sum of odd numbers
My code takes integers as input, I still get an Eof:error. Please assist me. import numpy as np minimum=int(input()) maximum=int(input()) dstep=int(input()); x=np.arange(minimum,maximum,dstep) print(x[(x%2==1)].sum())
8 odpowiedzi
+ 1
Israel Mutebi
Working fine.
Can you give inputs on which code is not working?
+ 3
Per Bratthammar
Thx for the response. My input is like (a,b,c) format
+ 3
Israel Mutebi
Sololearn supports inputs with separate lines.
If you want to take input like a,b,c
Then you have to one input and then you have to split that to get 3 separate value
s = input()
arr = s.split(',')
a = arr[0]
b = arr[1]
c = arr[2]
+ 2
You can link your code like this:
Go to Code section, click +, select the programming language, insert your code and save.
Come back to this thread, click +, Insert Code, sort for My Code Bits, select your code.
If it is a sololearn task, please mention course name and task number.
Please tag "Python"
+ 2
Hi Israel Mutebi
If you test your code in SoloLearns Playground, when you input your values, do yo input them in a line like this:
1 30 3
or like this:
1
30
3
?
+ 1
Israel Mutebi
You have to take all inputs with separate lines like
1
10
1
Then enter
+ 1
So Israel Mutebi
Now try the other way. In the input box, put every value on a new line before you push Submit, like:
1
30
3
0
A͢J
Line4: Eof:error when reading a line. I don't know yet how to get that right