Discuss Scratch

Hai1-2-37
Scratcher
39 posts

Python programming language

Ricky-Jan_test wrote:

Hai1-2-37 wrote:

This is for an assignment!
for x in range(4):
for y in range(3):
print(f'({x}, {y})')

Cool, looks like a two demantion matrix
This is to the x and y positions using nested loops.
Hai1-2-37
Scratcher
39 posts

Python programming language

Ricky-Jan_test wrote:

Hai1-2-37 wrote:

This is for an assignment!
for x in range(4):
for y in range(3):
print(f'({x}, {y})')

Cool, looks like a two demantion matrix
What's demantion matrix?
Hai1-2-37
Scratcher
39 posts

Python programming language

Newest piece of code for an exercise!
numbers =
max_numbers = numbers
for numbers in numbers:
if numbers > max_numbers:
max_numbers = numbers
print(max_numbers)
matrix = [
,
,

]
for row in matrix:
for item in row:
print(item)
numbers =
numbers.index(5)
numbers.sort()
print(numbers)
spectre_specs
Scratch Team
1000+ posts

Python programming language

This is a duplicate topic. I'll merge this thread into the earlier one.

Mod Squad
Ricky-Jan_test
Scratcher
21 posts

Python programming language

Hai1-2-37 wrote:

Newest piece of code for an exercise!

Really good! You learned how to use the list, but
you can try to use better variable names as “for numbers in numbers” is easily confused
mumu245
Scratcher
1000+ posts

Python programming language

Hai1-2-37 wrote:

(#1036)

Ricky-Jan_test wrote:

swiftcodingbird wrote:

Do the numbers mean where it starts from and where it ends?

Correct! But be careful:
for i in range(0, 10):
“i” will only go from 0 to 9

You can also omit zero (I'm used to not omitting):
for i in range(10):
The output is the same
But why isn't there a 10? Range is between 0 and 10.
Because when you have a list of length 10, the indexes are 0 to 9, and range() is designed to match that. Use range(0, 10 + 1).

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

Python programming language

Working on a github alternative, all made in Python:



Note however, that's not the app's code, it's something unrelated, but the app itself will also be free and open source.

select this text then press Ctrl+Shift+Down to read more
kingKASEtheGREATalt
Scratcher
100+ posts

Python programming language

i host my entire website in python

Last edited by kingKASEtheGREATalt (March 26, 2024 16:55:57)


kingKASEtheGREATalt
Scratcher
100+ posts

Python programming language

i also made an image format in python:
https://github.com/c00lkase/cmi-image

Hai1-2-37
Scratcher
39 posts

Python programming language

Ricky-Jan_test wrote:

Hai1-2-37 wrote:

Newest piece of code for an exercise!

Really good! You learned how to use the list, but
you can try to use better variable names as “for numbers in numbers” is easily confused
Yeah, I'm sorry about that. I'll try to come up with better variable names next time. Thank you for telling me that!
Hai1-2-37
Scratcher
39 posts

Python programming language

Ricky-Jan_test wrote:

Hai1-2-37 wrote:

Newest piece of code for an exercise!

Really good! You learned how to use the list, but
you can try to use better variable names as “for numbers in numbers” is easily confused
I've learnt about dictionaries! Here is one of my code pieces:
coordinates = (1, 2, 3)
x, y, z = coordinates
print(f'{x}, {y}, {z}')
customer = {
“name”: “Thanh Nguyen”,
“age”: 46,
“is_verified”: True
}
customer = “Hai Nguyen”
print(customer.get(“name”))
phone_numbers_intergers = input(“Phone: ”)
number_translation = {
“1”: “one”,
“2”: “two”,
“3”: “three”,
“4”: “four”
}
output = “”
for each_digit in phone_numbers_intergers:
output += number_translation.get(each_digit, “!”) + “ ”
print(output)
Ricky-Jan_test
Scratcher
21 posts

Python programming language

Hai1-2-37 wrote:

coordinates = (1, 2, 3)
x, y, z = coordinates
print(f'{x}, {y}, {z}')
customer = {
    "name": "Thanh Nguyen",
    "age": 46,
    "is_verified": True
}
customer["name"] = "Hai Nguyen"
print(customer.get("name"))
phone_numbers_intergers = input("Phone: ")
number_translation = {
    "1": "one",
    "2": "two",
    "3": "three",
    "4": "four"
}
output = ""
for each_digit in phone_numbers_intergers:
   output += number_translation.get(each_digit, "!") + " "
   print(output)

This is really good!

Last edited by Ricky-Jan_test (March 28, 2024 08:07:04)

Hai1-2-37
Scratcher
39 posts

Python programming language

Ricky-Jan_test wrote:

Hai1-2-37 wrote:

coordinates = (1, 2, 3)
x, y, z = coordinates
print(f'{x}, {y}, {z}')
customer = {
    "name": "Thanh Nguyen",
    "age": 46,
    "is_verified": True
}
customer["name"] = "Hai Nguyen"
print(customer.get("name"))
phone_numbers_intergers = input("Phone: ")
number_translation = {
    "1": "one",
    "2": "two",
    "3": "three",
    "4": "four"
}
output = ""
for each_digit in phone_numbers_intergers:
   output += number_translation.get(each_digit, "!") + " "
   print(output)

This is really good!
Thank you!
Hai1-2-37
Scratcher
39 posts

Python programming language

My emoji converter!
message = input(“>”)
words = message.split(' ')
emojis = {
”: “
Hai1-2-37
Scratcher
39 posts

Python programming language

Hai1-2-37 wrote:

My emoji converter!
message = input(“>”)
words = message.split(' ')
emojis = {
”: "
Wait why isn't it showing the whole thing?
message = input(“>”)
words = message.split(' ')
emojis = {
”: “
mybearworld
Scratcher
1000+ posts

Python programming language

Emoji aren't supported by the Scratch forums.

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

Python programming language

mybearworld wrote:

(#1056)
Emoji aren't supported by the Scratch forums.
No, this is Scratch-wide. A few emojis are supported, for example: ☠️ ✝️ ™️ ☺️

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]
mybearworld
Scratcher
1000+ posts

Python programming language

kkidslogin wrote:

mybearworld wrote:

(#1056)
Emoji aren't supported by the Scratch forums.
No, this is Scratch-wide. A few emojis are supported, for example: ☠️ ✝️ ™️ ☺️
I should've elaborated - in the forums, an emoji will cause everything after the emoji (and the emoji itself) to be removed. On the Scratch website, only the emoji get silently removed.

Signatures are the only place where assets links still work.
Hai1-2-37
Scratcher
39 posts

Python programming language

An assignment on inheritance!
class Mammal:
def walk(self):
print(“walk”)
print(“jump”)
print(“eat”)


class Dog(Mammal):
def bark(self):
print(“bark”)

dog1 = Dog()
dog1.walk()
dog1.bark()
DifferentDance8
Scratcher
1000+ posts

Python programming language

kingKASEtheGREATalt wrote:

i host my entire website in python
uhh you might want to get rid of that link as it contains a dizzy

R.I.P Zydrolic, 2023-2024

Powered by DjangoBB