【问题标题】:What function could be workaround of this Scratch block in Python?Python中这个Scratch块的解决方法是什么?
【发布时间】:2022-01-03 12:57:16
【问题描述】:

我想知道,这个 Scratch 块的解决方法/替换是什么:

在 Python 中。我知道在 JavaScript 中,答案是:

"..."[... - 1]

【问题讨论】:

  • 你有没有真正尝试过使用 Python?
  • 是的,我知道。很多。
  • *一半是初学者,一半不是。但我还是知道很多
  • @RixTheTyrunt 我知道有人告诉我你应该先做研究和测试自己,然后再问听起来很烦人,但这是事实。
  • @RixTheTyrunt Answering your own question 被接受,甚至被鼓励。但不要为此使用评论;请发布答案。哦,使用大写字母并不能使信息更清晰。

标签: python mit-scratch


【解决方案1】:

代码和JavaScript中的一样,比如:

var alphabet = "ABCDEFGHIJKLNOPQRSTUVWXYZ"
var letter1 = alphabet[0]
var letter2 = alphabet[1]
var letter3 = alphabet[2]
var letter123 = letter1 + letter2 + letter3

alert("The first three letters of the alphabet are: " + letter123)

我很d**b

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-23
    • 2018-07-17
    • 1970-01-01
    相关资源
    最近更新 更多