I have tested in Companion
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()
Lags my entire phone
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:
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
file2 = open(r"D:\MyFile2.txt",“w+”)
Where have you declared File
object?
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.
Without using list
You have to use
this list:
12345678910111213141516
The kode has to be for a list.
This is Python.
Seems Python is quite different from Java
I will have to start learning it soon
Did you see my entire post?
Btw, it is not needed to use list unless you required…
Did you see my entire post
Yes, I know you have another solution, mate! I just remembered you that you don’t need a version without lists.
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…
mate
Rule 1 of every internet forum.
Short answer: overuse. It gets annoying quickly; on the internet it’s better to not use such additional words. For example, I’m just Kanishka; not Kanishka S1r, and absolutely not anyone’s br0ther.
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.
it might return more then one digits
nope, it will return the list item with the given input index, so it can’t be two or more list items.
I think
digit (only one)
Isn’t that you say
???
Please right-click > Export blocks as PNG