Discuss Scratch

Firedrake969
Scratcher
1000+ posts

Python programming language

amgames wrote:

For the guys hating on Python's syntax choices.

Sometimes people design languages just to get a concept out there, so other people can refine it and advance the programming field. Python was one of these languages, except the people refining the concept turned out to be the Python community.

If you don't like Python's syntax, then you don't like programming using Python. Just use something else. Python wasn't made to be a good C clone.
Nobody's hating on it; we're just saying how we prefer other languages due to their non-reliance on white space.

fission wrote:

AonymousGuy wrote:

WHY WOULD YOU EVER MAKE AN IF STATEMENT RELY ON WHITESPACE TO KNOW WHAT CODE IT WERE TO RUN???
Something tells me you wouldn't like this language
oh God no help me

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
AonymousGuy
Scratcher
1000+ posts

Python programming language

amgames wrote:

For the guys hating on Python's syntax choices.

Sometimes people design languages just to get a concept out there, so other people can refine it and advance the programming field. Python was one of these languages, except the people refining the concept turned out to be the Python community.

If you don't like Python's syntax, then you don't like programming using Python. Just use something else. Python wasn't made to be a good C clone.
I never said Python was made to be a good C clone.

I'm just giving my opinion on what I think about the syntax choices.

And I have done a bit of dabbling in making languages myself - my first ones that I made in Scratch had even worse syntax.

fission wrote:

AonymousGuy wrote:

WHY WOULD YOU EVER MAKE AN IF STATEMENT RELY ON WHITESPACE TO KNOW WHAT CODE IT WERE TO RUN???
Something tells me you wouldn't like this language. Note that the text in the examples is not the code. To see the code, you need to highlight the page.
Eh, I've heard of it before. I've read a lot on an esoteric language wiki.
amgames
New to Scratch
100+ posts

Python programming language

Firedrake969 wrote:

amgames wrote:

For the guys hating on Python's syntax choices.

Sometimes people design languages just to get a concept out there, so other people can refine it and advance the programming field. Python was one of these languages, except the people refining the concept turned out to be the Python community.

If you don't like Python's syntax, then you don't like programming using Python. Just use something else. Python wasn't made to be a good C clone.
Nobody's hating on it; we're just saying how we prefer other languages due to their non-reliance on white space.

AonymousGuy wrote:

WHY WOULD YOU EVER MAKE AN IF STATEMENT RELY ON WHITESPACE TO KNOW WHAT CODE IT WERE TO RUN???

amgames
programmer ~ artist in training ~ pianist
Firedrake969
Scratcher
1000+ posts

Python programming language

amgames wrote:

Firedrake969 wrote:

amgames wrote:

For the guys hating on Python's syntax choices.

Sometimes people design languages just to get a concept out there, so other people can refine it and advance the programming field. Python was one of these languages, except the people refining the concept turned out to be the Python community.

If you don't like Python's syntax, then you don't like programming using Python. Just use something else. Python wasn't made to be a good C clone.
Nobody's hating on it; we're just saying how we prefer other languages due to their non-reliance on white space.

AonymousGuy wrote:

WHY WOULD YOU EVER MAKE AN IF STATEMENT RELY ON WHITESPACE TO KNOW WHAT CODE IT WERE TO RUN???
He is simply asking a spirited question.

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
AonymousGuy
Scratcher
1000+ posts

Python programming language

Firedrake969 wrote:

amgames wrote:

Firedrake969 wrote:

amgames wrote:

For the guys hating on Python's syntax choices.

Sometimes people design languages just to get a concept out there, so other people can refine it and advance the programming field. Python was one of these languages, except the people refining the concept turned out to be the Python community.

If you don't like Python's syntax, then you don't like programming using Python. Just use something else. Python wasn't made to be a good C clone.
Nobody's hating on it; we're just saying how we prefer other languages due to their non-reliance on white space.

AonymousGuy wrote:

WHY WOULD YOU EVER MAKE AN IF STATEMENT RELY ON WHITESPACE TO KNOW WHAT CODE IT WERE TO RUN???
He is simply asking a spirited question.
A very spirited question.

It's basically my one major complaint with the language.

The rest of it is fine.
amgames
New to Scratch
100+ posts

Python programming language

AonymousGuy wrote:

A very spirited question.

It's basically my one major complaint with the language.

The rest of it is fine.

Well, if you don't like if statements, then you won't like lambda statements.

x=lambda y:y*2
print(x(2)) # prints 4
# check out how weird this is!
x=[lambda x:x*(i+2) for i in range(5)]
assert x[0](2) == x[1](2) == x[2](2) == x[3](2) == x[4](2)
# ...that doesn't fail. They all return 12.

amgames
programmer ~ artist in training ~ pianist
Firedrake969
Scratcher
1000+ posts

Python programming language

amgames wrote:

AonymousGuy wrote:

A very spirited question.

It's basically my one major complaint with the language.

The rest of it is fine.

Well, if you don't like if statements, then you won't like lambda statements.

x=lambda y:y*2
print(x(2)) # prints 4
# check out how weird this is!
x=[lambda x:x*(i+2) for i in range(5)]
assert x[0](2) == x[1](2) == x[2](2) == x[3](2) == x[4](2)
# ...that doesn't fail. They all return 12.
When I was learning Python on CodeAcademy… I hated those.

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
DodgyDodo
Scratcher
22 posts

Python programming language

I don't use python but I'm using scratch to develop my own scripts language


when green flag clicked

ask [scripts:] and wait
add (answer) to [Scripts]
navysmeagol_175
Scratcher
100+ posts

Python programming language

Rumanti wrote:

I was about to make a Python thread, but luckily I found this on my search.

Python is awesome! I am currently doing Programming for Everybody course on Coursera. It teaches Python. I am addicted to Python since then.

Also, this is one of my Python project. It flips text backward, just like my newest project, Flip That Text. (For your info, Flip That Text is actually based on the Python version)

plain_text = raw_input("Text to flip backwards : ")

char_counter = 0
char = None
result = None

while True:
while True:
char_counter = char_counter - 1
char = plain_text[char_counter]
if result is None:
result = char
else:
result = result + char
if len(result) == len(plain_text):
break

print result
x = raw_input("> ")
if x == "done":
break

And a question: (from a newbie )
How do you generate random numbers? I think I read about it somewhere but I didn't remember where.
Can someone help?
isnt there a built in function that does that?
Sid72020123
Scratcher
500+ posts

Python programming language

I have made a Python library named “siddhesh”. To know more visit this website!

Sid72020123
Vaibhs11
Scratcher
1000+ posts

Python programming language

#why is there no forever loop ;-;
#XD oh well,
while 1=1:
 print("echo world")

Last edited by Vaibhs11 (Jan. 8, 2021 04:31:08)

mybearworld
Scratcher
1000+ posts

Python programming language

Vaibhs11 wrote:

#why is there no forever loop ;-;
#XD oh well,
while 1=1:
 print("echo world")
This code wouldn't work
a=1 # Sets a variable called "a" to 1. (You couldn't set numbers tho)
a==1 # Is a equal to 1?
Also it's while TRUE and not while 1==1

Signatures are the only place where assets links still work.
mybearworld
Scratcher
1000+ posts

Python programming language

DodgyDodo wrote:

I don't use python but I'm using scratch to develop my own scripts language


when green flag clicked

ask [scripts:] and wait
add (answer) to [Scripts]
it's way easier to do that in python

Signatures are the only place where assets links still work.
Vaibhs11
Scratcher
1000+ posts

Python programming language

mybearworld wrote:

Vaibhs11 wrote:

#why is there no forever loop ;-;
#XD oh well,
while 1=1:
 print("echo world")
This code wouldn't work
a=1 # Sets a variable called "a" to 1. (You couldn't set numbers tho)
a==1 # Is a equal to 1?
Also it's while TRUE and not while 1==1
oops
forgot operators
mybearworld
Scratcher
1000+ posts

Python programming language

Anyone hating the fact that you don't need ;?
Well then just use them

Python won't care

Signatures are the only place where assets links still work.
Vaibhs11
Scratcher
1000+ posts

Python programming language

mybearworld wrote:

Anyone hating the fact that you don't need ;?
Well then just use them

Python won't care
Anyone hating the fact that I don't know how to close loops?
also no, without is much better but the
Anyone hating the fact that you need : instead of {}?

Last edited by Vaibhs11 (Jan. 8, 2021 13:05:24)

mybearworld
Scratcher
1000+ posts

Python programming language

Vaibhs11 wrote:

Anyone hating the fact that I don't know how to close loops?
for n in range(10)
    print("Countdown:", n)
print("\nLoop succesfully closed!")

Vaibhs11 wrote:

anyone hating the fact that you need : instead of {}?
Doesn't this look better
if 1 == 1:
    if 2 == 2:
        f = 3
        if 3 == 3:
            pass
        f = 5
    else:
        if 4 == 4:
            if 5 == 5:
                c = 6
print("The end")
if 1 == 1 {
if 2 == 2 {
f = 3
}
if 3 == 3 {
pass
}
f = 5
} else {
if 4 == 4 {
if 5 == 5 {
c = 6
}
}
}

Signatures are the only place where assets links still work.
mybearworld
Scratcher
1000+ posts

Python programming language

Rumanti wrote:

plain_text = raw_input("Text to flip backwards : ")

char_counter = 0
char = None
result = None

while True:
while True:
char_counter = char_counter - 1
char = plain_text[char_counter]
if result is None:
result = char
else:
result = result + char
if len(result) == len(plain_text):
break

print result
x = raw_input("> ")
if x == "done":
break
I'll try programming a reserver too.
def rev(x):
    y = ""
    for n in range(len(x)-1, -1, -1): y+= x[n]
    return y
while True:
    print(rev(input("Text: ")))
I don't think I can do it shorter
Edit: Ok now I found out a little more about slices…
def rev(x):
    return x[::-1]
while True:
    print(rev(input("Text")))
Another edit:
while True: print(input("Text")[::-1])
Another one:
while 1:print(input()[::-1])

Last edited by mybearworld (Feb. 19, 2022 11:30:30)


Signatures are the only place where assets links still work.
mybearworld
Scratcher
1000+ posts

Python programming language

Anyone knows a way to put a “for” loop inside a “lambda”?

Signatures are the only place where assets links still work.

Powered by DjangoBB