+ 3

I'm trying to print the multiples of 3 and 5 below 100 using the below python code. But test case are not passed.

import numpy as np x = np.arrange(1,100) print(x[(x%3==0) & (x%5==0)])

17th Jul 2022, 4:25 PM
Vishaka Saxena
Vishaka Saxena - avatar
5 Respuestas
+ 3
Sry.. You have incorrect method name in arange, have extra r. import numpy as np x = np.arange(1,100) print(x[(x%3==0) & (x%5==0)])
17th Jul 2022, 4:39 PM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 That's right here Vishaka Saxena There is only single 'r' in arrange
17th Jul 2022, 4:38 PM
A͢J
A͢J - avatar
+ 2
Thank you A͢J Jayakrishna🇮🇳 . Now it's working🙏
17th Jul 2022, 4:41 PM
Vishaka Saxena
Vishaka Saxena - avatar
+ 1
Jayakrishna🇮🇳 not working. Btw & is used for and operation in numpy
17th Jul 2022, 4:38 PM
Vishaka Saxena
Vishaka Saxena - avatar
0
Not tested but & is 'bitwise and' operator. In python, use and operator for logical and operation. edit: ok. fine with numpy.. not seen it clearly
17th Jul 2022, 4:35 PM
Jayakrishna 🇮🇳