这个脚本有什么问题?

时间:2019-12-27 02:53:50

标签: python

message = 'hello world'

print(message)

a=input('pick a between 1 and 11 and I will tell you what character it is in the phrase "hello world"')
    if a==("0")
        print(message[0])
    if a==("1")
        print(message[1])
    if a==("2")
        print(message[2])
    if a==("3")
        print(message[3])
    if a==("4")
        print(message[4])
    if a==("5")
        print(message[5])
    if a==("6")
        print(message[6])
    if a==("7")
        print(message[7])
    else print("It doesn't go that high!")

b=input("press any button to end")

我正在尝试编写一个脚本,当您输入一些短语时它会告诉您该字母是什么数字。 IE;

如果短语是“ hello”。 而用户输入2则得到数字“ e”,或者输入5则得到“ o”。 当我打开它时,它立即崩溃,我知道这意味着脚本有问题。 我该如何解决?

1 个答案:

答案 0 :(得分:0)

"aggs" => [
    "CMS" => [
        "nested" => [
            "path" => "cms",
        ],
        "aggs" => [
            "FILTER" => [
                "filter" => [
                    "bool" => [
                        "should" => [
                            [
                                "match" => [
                                    "cms.cli_id" => 0
                                ]
                            ],
                            [
                                "bool" => [
                                    "must" => [
                                        [
                                            // I'm planing to create a bool method here to test if cli_id is equalis to the logged-in client's ID
                                        ]
                                    ]
                                ]
                            ]
                        ]
                    ]
                ],
                "aggs"=> [
                    "TONALITY"=> [
                        "terms"=> [
                            "field" => "cms.cmx_sentiment"
                        ],
                    ]
                ]
            ]
        ]
    ]
]

您忘记了冒号和elif语句