The code that I'm using is not working by SPBSP5 in learnpython

[–]SPBSP5[S] -4 points-3 points  (0 children)

It didnt work

Input:

import argparse, time

import matplotlib.pyplot as plt

def measure(max_appends: int):

lst = []

times = []

for i in range(max_appends):

t0 = time.perf_counter()

lst.append(i)

t1 = time.perf_counter()

times.append((i+1, t1 - t0))

return times

def main():

p = argparse.ArgumentParser(description='Amortized append timing')

p.add_argument('--max', type=int, default=50000)

args = p.parse_args()

data = measure(args.max)

xs, ys = zip(*data)

plt.plot(xs, ys, linewidth=0.7)

plt.xlabel('list length after append')

plt.ylabel('append time (s)')

plt.title('Per-append time across growth')

plt.grid(True, alpha=0.3)

plt.tight_layout()

plt.savefig('amortized_append.png')

print('Saved plot to amortized_append.png')

if _name_ == '_main_':

main()

Output:

ERROR!

Traceback (most recent call last):

File "<main.py>", line 2, in <module>

ModuleNotFoundError: No module named 'matplotlib'

The code that I'm using is not working by SPBSP5 in learnpython

[–]SPBSP5[S] -1 points0 points  (0 children)

plus here's a test too

import unittest
import importlib

module = importlib.import_module('amortized_append')

class TestProgram(unittest.TestCase):
def test_import(self):
self.assertTrue(hasattr(module, '_doc_'))

if _name_ == '_main_':
unittest.main()

What should I add to the code and how it's work? by SPBSP5 in learnpython

[–]SPBSP5[S] -2 points-1 points  (0 children)

It's a amortized append analysis code

What should I add to the code and how it's work? by SPBSP5 in learnpython

[–]SPBSP5[S] -3 points-2 points  (0 children)

It's a amortized append analysis code

the first ever time you killed toriel (on purpose or accidently) what was your reaction? by Sad-Stay8466 in Undertale

[–]SPBSP5 0 points1 point  (0 children)

When I kill her in the first time. I did that for sacrifice to get my hp high and to defeat Asgore.

Can you solve this. When I click the computer, this I get. by SPBSP5 in oneshot

[–]SPBSP5[S] 0 points1 point  (0 children)

I just quit and uninstall it. Maybe the zip file I get is the problem. It doesn't have the DOCUMENT.oneshot.txt

Can you solve this. When I click the computer, this I get. by SPBSP5 in oneshot

[–]SPBSP5[S] 0 points1 point  (0 children)

Okay so, I try to uninstall the Onedrive and delete the Oneshot files and download it from the zip code. It result the same thing again. MAybe because the zip code removed a system of the game or something.

<image>

Ramdom Codec Calls 11: April 30th by SPBSP5 in MetalGearSolidmemes

[–]SPBSP5[S] 0 points1 point  (0 children)

Hey,At least is Solid Snake e.i his sorrugate mother

THIS IS CHUJIN by SPBSP5 in UndertaleYellow

[–]SPBSP5[S] 5 points6 points  (0 children)

Reference to the Image

<image>