Discuss Scratch

Steve0Greatness
Scratcher
1000+ posts

Is Scratch similar to Python?

Scratch seems really close to Python, here's a comparison:
when green flag clicked
say [Hello world!] for (2) secs
ask [How's your day going?] and wait
if <<(answer) contains [G]? ::operators> or <(answer) contains [y]? ::operators>> then
say [Great!]
else
say [Oh...]
end
from time import sleep
print ("Hello world")
G = "g"
gl = "G"
Y = "y"
yl = "Y"
sleep(2)
answer = input "How's your day going?"
if answer in gl or answer in G or answer in Y or answer in yl:
       print ("Great!")
else:
       print("ohhhh...")
-Charon-
Scratcher
1000+ posts

Is Scratch similar to Python?

You could say that, but most of the concepts that you'll find in Scratch you'll find in a variety of other languages, not just Python. It just so happens that Python's syntax is (dare I say it) simpler (at least compared to C++ and Java), making it look similar to Scratch.

Fundamentally, though, they're different languages. Scratch is actually built from JavaScript, not Python. While Python is an object-oriented programming language, Scratch is not. So, technically, Python is more similar to Snap! than it is to Scratch.

You can certainly find a variety of similarities and differences between the two languages, and other languages beyond Python. It's all very interesting.

Last edited by -Charon- (Feb. 18, 2021 16:13:53)

Steve0Greatness
Scratcher
1000+ posts

Is Scratch similar to Python?

-Charon- wrote:

You could say that, but most of the concepts that you'll find in Scratch you'll find in a variety of other languages, not just Python. It just so happens that Python's syntax is (dare I say it) simpler (at least compared to C++ and Java), making it look similar to Scratch.
You don't have to say “Dare I say”, because it's just true.
Fundamentally, though, they're different languages. Scratch is actually built from JavaScript, not Python. While Python is an object-oriented programming language, Scratch is not. So, technically, Python is more similar to Snap! than it is to Scratch.
really?
You can certainly find a variety of similarities and differences between the two languages, and other languages beyond Python. It's all very interesting.
Yeah, such as how python needs a billion different “Libraries” inorder to do what most people do in Scratch.
-Charon-
Scratcher
1000+ posts

Is Scratch similar to Python?

Steve0Greatness wrote:

Yeah, such as how python needs a billion different “Libraries” inorder to do what most people do in Scratch.
Scratch has extensions, which function similarly to libraries.
mybearworld
Scratcher
1000+ posts

Is Scratch similar to Python?

It's not the same.
import time
if __name__ == "__main__":
    print("Hello world!")
    time.sleep(2)
    # no way to remove it
    answer = input("How's your day going?")
    if "g" in answer.lower() or "y" in answer.lower():
        print("Good!")
    else:
        print("ooohhh...")
Though, it shares similarities, and thus it's good for Scratchers to switch to python.
Basic88
Scratcher
1000+ posts

Is Scratch similar to Python?

It's similar to any programming language. The Scratch Team made sure when they were making the site. You can see similarities from Lua, Java, and C++
Maximouse
Scratcher
1000+ posts

Is Scratch similar to Python?

Scratch only has very basic programming concepts, which means it's similar to most programming languages.

-Charon- wrote:

So, technically, Python is more similar to Snap! than it is to Scratch.
This isn't completely true. Snap! is much more similar to JavaScript than to Python.

Powered by DjangoBB