Python Forum
How to solve problem 1181 of the URI with numpy.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to solve problem 1181 of the URI with numpy.
#3
I only know how to work this way I tried to understand the numpy library more without success.

l = int (input ())
opera = input ()
  

m = []
for i in range (12):
     m.append ([])

for i in range (12):
     for j in range (12):
         x = float (input ())
         m [i] .append (x)
       

if opera == 'S':
     sum = 0
     for k in m [l]:
         sum = sum + k
     print (sum)
if opera == 'M':
     med = 0
     sum = 0
     for k in m [l]:
         sum = sum + k
     med = sum / 12
     print (med)
buran write Mar-22-2021, 04:09 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
RE: How to solve problem 1181 of the URI with numpy. - by thiagohps - Mar-22-2021, 03:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to solve this problem Python configuration? magomes 5 742 Mar-22-2024, 11:11 PM
Last Post: magomes
Star Interesting Intro to python problem I can't solve. Honestworker 5 12,490 Mar-04-2021, 02:05 AM
Last Post: BashBedlam
  solve probability problem by python Dreammer 1 1,927 Dec-24-2020, 09:51 AM
Last Post: Larz60+
  numpy problem nats 0 1,858 Jan-12-2020, 02:54 PM
Last Post: nats
  Algorithm to solve a case of Travelling Salesman Problem Ale888 3 3,122 Dec-11-2018, 07:49 PM
Last Post: buran
  how to solve this problem. IndexError: axis 2 out of bounds [0, 2) bedio 10 9,132 Nov-21-2017, 02:47 PM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020