skulpt / skulpt

Skulpt is a Javascript implementation of the Python programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A bug for % formatting statement

alexwenbj opened this issue · comments

string = "hello"
width = 10
formatted_string = "%*s" % (width // 2 + len(string) // 2, string)
print(formatted_string)

Should print out hello,but in skulpt.org, it printed out 7.

Moreover, the below code raised an external error ExternalError: TypeError: Cannot read properties of null (reading '9'):

string = "hello"
width = 10
formatted_string = "{:^{}}".format(string, width)
print(formatted_string)

print('%2s'%("ab")) should print out ab,but in skulpt.org,it printed out ab