+ 1
Head on the house block
Hello comrades I need help with this: You are given an array that holds the square footage data for houses on a particular street. A new house has just been constructed on that street. Modify your program to take the new house value as input, add it to the array, and output the array sorted in ascending order.
11 Respostas
+ 3
Joshua chola
arrange will not work here
You have to take new input value
Then append that value in existing array
Then sort array
h = int(input())
data = np.append(data, h)
data = np.sort(data)
print (data)
+ 1
Show your attempt
+ 1
Shantanu singh
Because input () bydefault returns String not int or float so for int or float you need to cast and please don't use inappropriate language.
0
Joshua chola
Where is your attempts.
0
🅰🅹
Okay great this helps thanks
0
Solved already
0
fuck bro when i use h = input() it didn't work but when is use h = int(input()) it worked out
0
print(np.sort(np.append(data, int(input()))))
0
it doesn't work
0
import numpy as np
data = np.array([1000, 2500, 1400, 1800, 900, 4200, 2200, 1900, 3500])
data = np.append(data, int(input()))
print(np.sort(data))
- 6
import numpy as np
data = np.array([1000, 2500, 1400, 1800, 900, 4200, 2200, 1900, 3500])
x = np.arange('x',)
print(x)