Daily Challenge #78

I have tested in Companion :grin:

1 Like

Summary

blocks

2 Likes

Because our solutions are not optimized. I ran a test and it needs to store a text file of 6 million characters and then get the 1 millionth character, which takes up a lot of memory and crashes most of the devices.

Here is the file if anyone wants to look at it MyFile2.txt (5.6 MB)

Also, if anyone wants to run the code for themselves here it is:

output = ""

for i in range(1,1000001):
    output+=str(i)

file2 = open(r"D:\MyFile2.txt","w+")
file2.write(output)
file2.close()
1 Like

Ok ok. Then use 100.

Well, guys, since I wasn’t online since a long time, I would like to excuse myself bc I had real life school which cannot be skipped like pressing minimize screen.

So, you were waiting a long time and your blocks are awesome.

My solution is totally untested, though I have no device for testing.

So sorry if it has some bugs. Could you test it? Also, tell me please how many blocks you all used, then i will choose a solution.

Yoshi

Here:

1 Like

There’s no bugs for all solution. Both @vknow360 and @Mateja ave the extremely similar answer, but vknow360 is fist so he got the champion :muscle: :partying_face:

Where have you declared File object?:thinking:

Can you explain your question more?

In Java we use this to construct File object:

File file = new File("/path/to/file");

But there is no declaration in your example.

This is Python.

You have to use

The kode has to be for a list.

1 Like

Seems Python is quite different from Java :sweat_smile:
I will have to start learning it soon :wink:

1 Like

Did you see my entire post?
Btw, it is not needed to use list unless you required…

Yes, I know you have another solution, mate! I just remembered you that you don’t need a version without lists.
:grin:

Btw, someone checked my solution yet? has it bugs? I’m sure it has. Sry for that, but I cannot test now. Am soo sorry… :disappointed:

Rule 1 of every internet forum.

Did I something wrong? Off-topic

Yours has a big problem, add join with seperator in the result or else it might return more then one digits.

1 Like

nope, it will return the list item with the given input index, so it can’t be two or more list items.

I think

Isn’t that you say
???

Please right-click > Export blocks as PNG