+ 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.

29th Mar 2021, 11:01 AM
Joshua chola
Joshua chola - avatar
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)
29th Mar 2021, 11:23 AM
AÕĘJ
AÕĘJ - avatar
+ 1
Show your attempt
29th Mar 2021, 12:07 PM
Papa Penguin
+ 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.
16th Sep 2021, 10:08 AM
AÕĘJ
AÕĘJ - avatar
0
Joshua chola Where is your attempts.
29th Mar 2021, 11:05 AM
AÕĘJ
AÕĘJ - avatar
0
ūüÖįūüÖĻ Okay great this helps thanks
29th Mar 2021, 11:27 AM
Joshua chola
Joshua chola - avatar
0
Solved already
29th Mar 2021, 12:08 PM
Joshua chola
Joshua chola - avatar
0
fuck bro when i use h = input() it didn't work but when is use h = int(input()) it worked out
13th Jul 2021, 9:08 AM
Shantanu singh
0
print(np.sort(np.append(data, int(input()))))
16th Sep 2021, 10:04 AM
TrebleClef20
TrebleClef20 - avatar
0
it doesn't work
30th Dec 2021, 8:13 AM
Zero two
Zero two - avatar
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))
30th Nov 2022, 8:45 PM
Ronalds Skulme
Ronalds Skulme - avatar
- 6
import numpy as np data = np.array([1000, 2500, 1400, 1800, 900, 4200, 2200, 1900, 3500]) x = np.arange('x',) print(x)
29th Mar 2021, 11:15 AM
Joshua chola
Joshua chola - avatar