Skip to content

可能需要更周密的检查 #1

Open
@Ray7788

Description

@Ray7788

https://github.com/Ray7788/NowCoderPython/blob/26a6eeef80e0cf86a8df8144b4e899249522ed8b/NP79.py#L1

以下是建议版本

import re

input_str = input()

# 正则判断输入的是否是大小写字母

result_low = re.findall(r"[a-z]", input_str)

result_up = re.findall(r"[A-Z]", input_str)
if (input_str in result_low)&nbs***bsp;(input_str in result_up):
    print(ord(input_str))
else:
    print("输入的不是字母")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions