Discuss Scratch

Knightbot63
Scratcher
1000+ posts

Python programming language

mybearworld wrote:

(#960)
…you can go outside of the class function. That's what it does. That's like saying “What's so great about food? Besides the fact that you can eat it.”
Can it also go outside of .py files?

Working on an RPG. Consistently losing followers because of inactivity.
I head to forums time-to-time. Not as much as I used to.
-TwentyFour-
Scratcher
500+ posts

Python programming language

I wanna learn python. Can you guys suggest best python for beginners tutorial in YT?
mumu245
Scratcher
1000+ posts

Python programming language

-TwentyFour- wrote:

I wanna learn python. Can you guys suggest best python for beginners tutorial in YT?
I don't watch videos, but I can suggest freecodecamp.

select this text then press Ctrl+Shift+Down to read more
ToastersUnited
Scratcher
1000+ posts

Python programming language

-TwentyFour- wrote:

I wanna learn python. Can you guys suggest best python for beginners tutorial in YT?
I find books easier. I used a blue one i forget what its called though. There are great ones on like amazon and stuff

I'm hosting Country Clash Minecraft, a minecraft server where you can join or create a nation, trade, engage in politics, go to war and more!
CCMC is a Country Clash RP spinoff. It is currently in a trial period where CCRP admins will observe the server and see whether or not it should continue.
CCMC uses a custom map with volcanoes, nether and end islands, winding rivers and more!
CCMC will start within the next two days or so. It has a 10 player limit at any time. Anyone can join, as long as you have a copy of Minecraft Java Edition or Minecraft Bedrock Edition

GoldenAlbans
Scratcher
55 posts

Python programming language

I'm good with raspberry pi's (as far as the hardware goes) but I have been sort of faking the python programming. Can anyone recommend a learning resource that is actually useful?

I’m not much on speeches. That’s all.

GoldenAlbans The Great wrote:

People don’t usually put quotes in signatures.
Follow @GoldenAlbans!
UnscrambledEgg
Scratcher
100+ posts

Python programming language

-TwentyFour- wrote:

I wanna learn python. Can you guys suggest best python for beginners tutorial in YT?
I'm not the best person to ask since my learning preferences are different but I usually read documents of different functions and their layouts.
TeenySpoon
Scratcher
500+ posts

Python programming language

GoldenAlbans wrote:

I'm good with raspberry pi's (as far as the hardware goes) but I have been sort of faking the python programming. Can anyone recommend a learning resource that is actually useful?
The official Python documentation is really useful.
You can also search up some coding practices like FizzBuzz.

⚜ TeenySpoon ⚜ Alt: TeenyTea
An absent-minded programmer/artist

A Random Pen Window Manager
⚜ Me ⚜ TeenyForkTeenyKnife

“We are pilgrims on the journey
We are travelers on the road
We are here to help each other
Walk the mile and bear the load”
- “The Servant Song”, David Haas
mumu245
Scratcher
1000+ posts

Python programming language

TeenySpoon wrote:

GoldenAlbans wrote:

I'm good with raspberry pi's (as far as the hardware goes) but I have been sort of faking the python programming. Can anyone recommend a learning resource that is actually useful?
The official Python documentation is really useful.
You can also search up some coding practices like FizzBuzz.
Not for the Pi though. For the hardware side, there is always Raspberry Pi Projects and the docs (very well written), also stackoverflow. Just browse them and see what you can make of it. Don't copy-paste.

select this text then press Ctrl+Shift+Down to read more
TeenySpoon
Scratcher
500+ posts

Python programming language

mumu245 wrote:

TeenySpoon wrote:

GoldenAlbans wrote:

I'm good with raspberry pi's (as far as the hardware goes) but I have been sort of faking the python programming. Can anyone recommend a learning resource that is actually useful?
The official Python documentation is really useful.
You can also search up some coding practices like FizzBuzz.
Not for the Pi though. For the hardware side, there is always Raspberry Pi Projects and the docs (very well written), also stackoverflow. Just browse them and see what you can make of it. Don't copy-paste.
Oh I see, the way I read it I thought the person was talking about Python in general.

⚜ TeenySpoon ⚜ Alt: TeenyTea
An absent-minded programmer/artist

A Random Pen Window Manager
⚜ Me ⚜ TeenyForkTeenyKnife

“We are pilgrims on the journey
We are travelers on the road
We are here to help each other
Walk the mile and bear the load”
- “The Servant Song”, David Haas
kkidslogin
Scratcher
1000+ posts

Python programming language

Sometimes the gymnastics I have to do in Python makes me laugh. This is real code from a web server I'm designing:
db["threads"].append(["Back online!", len(database.to_primitive(db["posts"])) - 1])

Forum Clout: 232,655. Alright, who ate my Kumquats? Finally foruming again. Support for reasons in OP and no support for all the other reasons.



Enjoy my music.

[small]non-member post, take whatever I say with a hint of salt and remember there's no authority behind it[/small]
__Falcon-Games__
Scratcher
1000+ posts

Python programming language

kkidslogin wrote:

Sometimes the gymnastics I have to do in Python makes me laugh. This is real code from a web server I'm designing:
db["threads"].append(["Back online!", len(database.to_primitive(db["posts"])) - 1])
Too readable.
db.__getitem__.__call__("threads".__str__.__call__()) = db.__getitem__.__call__("threads".__str__.__call__()).__add__.__call__([("Back online!").__str__.__call__(), database.to_primitive.__call__(db.__getitem__.__call__("posts")).__len__.__call__()])

Last edited by __Falcon-Games__ (Sept. 24, 2023 12:30:55)


Try out Noml!
kkidslogin
Scratcher
1000+ posts

Python programming language

__Falcon-Games__ wrote:

(#971)

kkidslogin wrote:

Sometimes the gymnastics I have to do in Python makes me laugh. This is real code from a web server I'm designing:
db["threads"].append(["Back online!", len(database.to_primitive(db["posts"])) - 1])
Too readable.
db.__getitem__.__call__("threads".__str__.__call__()) = db.__getitem__.__call__("threads".__str__.__call__()).__add__.__call__([("Back online!").__str__.__call__(), database.to_primitive.__call__(db.__getitem__.__call__("posts")).__len__.__call__()])
Ach ugh. How about this?

post_name = db["posts"][db["threads"][0][i]][0]
post_author = db["posts"][db["threads"][0][i]][1]
post_content = db["posts"][db["threads"][0][i]][2]

It's all in one “dictionary” because this is actually the replit.db class, so I only get one

square brackets go brrrr

Last edited by kkidslogin (Sept. 24, 2023 18:33:40)


Forum Clout: 232,655. Alright, who ate my Kumquats? Finally foruming again. Support for reasons in OP and no support for all the other reasons.



Enjoy my music.

[small]non-member post, take whatever I say with a hint of salt and remember there's no authority behind it[/small]
__Falcon-Games__
Scratcher
1000+ posts

Python programming language

kkidslogin wrote:

__Falcon-Games__ wrote:

(#971)

kkidslogin wrote:

Sometimes the gymnastics I have to do in Python makes me laugh. This is real code from a web server I'm designing:
db["threads"].append(["Back online!", len(database.to_primitive(db["posts"])) - 1])
Too readable.
db.__getitem__.__call__("threads".__str__.__call__()) = db.__getitem__.__call__("threads".__str__.__call__()).__add__.__call__([("Back online!").__str__.__call__(), database.to_primitive.__call__(db.__getitem__.__call__("posts")).__len__.__call__()])
Ach ugh. How about this?

post_name = db["posts"][db["threads"][0][i]][0]
post_author = db["posts"][db["threads"][0][i]][1]
post_content = db["posts"][db["threads"][0][i]][2]

It's all in one “dictionary” because this is actually the replit.db class, so I only get one

square brackets go brrrr
That's also too readable.

exec("".join([chr(x) for x in [105, 109, 112, 111, 114, 116, 32, 115, 121, 115, 10, 109, 97, 105, 110, 32, 61, 32, 115, 121, 115, 46, 109, 111, 100, 117, 108, 101, 115, 91, 34, 95, 95, 109, 97, 105, 110, 95, 95, 34, 93, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 110, 97, 109, 101, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 48, 93, 41, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 97, 117, 116, 104, 111, 114, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 49, 93, 41, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 99, 111, 110, 116, 101, 110, 116, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 50, 93, 93, 41]]))

Try out Noml!
kkidslogin
Scratcher
1000+ posts

Python programming language

__Falcon-Games__ wrote:

(#973)

kkidslogin wrote:

__Falcon-Games__ wrote:

(#971)

kkidslogin wrote:

Sometimes the gymnastics I have to do in Python makes me laugh. This is real code from a web server I'm designing:
db["threads"].append(["Back online!", len(database.to_primitive(db["posts"])) - 1])
Too readable.
db.__getitem__.__call__("threads".__str__.__call__()) = db.__getitem__.__call__("threads".__str__.__call__()).__add__.__call__([("Back online!").__str__.__call__(), database.to_primitive.__call__(db.__getitem__.__call__("posts")).__len__.__call__()])
Ach ugh. How about this?

post_name = db["posts"][db["threads"][0][i]][0]
post_author = db["posts"][db["threads"][0][i]][1]
post_content = db["posts"][db["threads"][0][i]][2]

It's all in one “dictionary” because this is actually the replit.db class, so I only get one

square brackets go brrrr
That's also too readable.

exec("".join([chr(x) for x in [105, 109, 112, 111, 114, 116, 32, 115, 121, 115, 10, 109, 97, 105, 110, 32, 61, 32, 115, 121, 115, 46, 109, 111, 100, 117, 108, 101, 115, 91, 34, 95, 95, 109, 97, 105, 110, 95, 95, 34, 93, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 110, 97, 109, 101, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 48, 93, 41, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 97, 117, 116, 104, 111, 114, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 49, 93, 41, 10, 115, 101, 116, 97, 116, 116, 114, 40, 109, 97, 105, 110, 44, 32, 34, 112, 111, 115, 116, 95, 99, 111, 110, 116, 101, 110, 116, 34, 44, 32, 100, 98, 91, 34, 112, 111, 115, 116, 115, 34, 93, 91, 100, 98, 91, 34, 116, 104, 114, 101, 97, 100, 115, 34, 93, 91, 48, 93, 91, 91, 108, 111, 99, 97, 108, 115, 40, 41, 46, 95, 95, 103, 101, 116, 105, 116, 101, 109, 95, 95, 40, 34, 105, 34, 41, 93, 93, 91, 50, 93, 93, 41]]))
i ' m i n p a i n n o w

Forum Clout: 232,655. Alright, who ate my Kumquats? Finally foruming again. Support for reasons in OP and no support for all the other reasons.



Enjoy my music.

[small]non-member post, take whatever I say with a hint of salt and remember there's no authority behind it[/small]
zaid1442011
Scratcher
500+ posts

Python programming language

Forgets that 0 isn't positive or negative:

*Remembers that I could leave the finish index empty*

I am a guy who codes weird stuff. Don’t check my GitHub only if you want stupid HTML pages (or something to host them). Check my platformer if you want to see something to see.

Profiles: GitHub.
You won't understand stuff in my signature because I talk about stuff in the ATs (Advanced Topics).
Check out this song for @griffpatch https://scratch.mit.edu/projects/887382049/



zaid1442011
Scratcher
500+ posts

Python programming language

Do you know why this is happening?

I am a guy who codes weird stuff. Don’t check my GitHub only if you want stupid HTML pages (or something to host them). Check my platformer if you want to see something to see.

Profiles: GitHub.
You won't understand stuff in my signature because I talk about stuff in the ATs (Advanced Topics).
Check out this song for @griffpatch https://scratch.mit.edu/projects/887382049/



mybearworld
Scratcher
1000+ posts

Python programming language

zaid1442011 wrote:

(#976)
Do you know why this is happening?
Whatever IDE you're using probably has a length limit on the output.

Signatures are the only place where assets links still work.
zaid1442011
Scratcher
500+ posts

Python programming language

mybearworld wrote:

(#977)

zaid1442011 wrote:

(#976)
Do you know why this is happening?
Whatever IDE you're using probably has a length limit on the output.
I was using w3schools.com's Try-it editor
I got it working in a Debian (I am to lazy to get my Mac, also I am on a Chromebook) ternimal, and it is working fine (till now). Now I have to wait till it finishes writing i's value 100000000000 times (which increases by 1 every time it loops through).

I am a guy who codes weird stuff. Don’t check my GitHub only if you want stupid HTML pages (or something to host them). Check my platformer if you want to see something to see.

Profiles: GitHub.
You won't understand stuff in my signature because I talk about stuff in the ATs (Advanced Topics).
Check out this song for @griffpatch https://scratch.mit.edu/projects/887382049/



mumu245
Scratcher
1000+ posts

Python programming language

zaid1442011 wrote:

(#978)

mybearworld wrote:

(#977)

zaid1442011 wrote:

(#976)
Do you know why this is happening?
Whatever IDE you're using probably has a length limit on the output.
I was using w3schools.com's Try-it editor
I got it working in a Debian (I am to lazy to get my Mac, also I am on a Chromebook) ternimal, and it is working fine (till now). Now I have to wait till it finishes writing i's value 100000000000 times (which increases by 1 every time it loops through).
Use a for loop, it might be faster.

select this text then press Ctrl+Shift+Down to read more
zaid1442011
Scratcher
500+ posts

Python programming language

mumu245 wrote:

(#979)

zaid1442011 wrote:

(#978)

mybearworld wrote:

(#977)

zaid1442011 wrote:

(#976)
Do you know why this is happening?
Whatever IDE you're using probably has a length limit on the output.
I was using w3schools.com's Try-it editor
I got it working in a Debian (I am to lazy to get my Mac, also I am on a Chromebook) ternimal, and it is working fine (till now). Now I have to wait till it finishes writing i's value 100000000000 times (which increases by 1 every time it loops through).
Use a for loop, it might be faster.
I stoped running it. Maybe you try it.

I am a guy who codes weird stuff. Don’t check my GitHub only if you want stupid HTML pages (or something to host them). Check my platformer if you want to see something to see.

Profiles: GitHub.
You won't understand stuff in my signature because I talk about stuff in the ATs (Advanced Topics).
Check out this song for @griffpatch https://scratch.mit.edu/projects/887382049/



Powered by DjangoBB