PAT(Advanced Level) Practice(with python)——1023 Have Fun with Numbers

Code

python 复制代码
N=  int(input())
D_N = 2*N
# print('Yes')

if len(str(D_N))>len(str(N)):
    print('No')
else:
    for s in str(D_N):
        if s not in str(N) or str(D_N).count(s)!=str(N).count(s):
            print("No")
            break
    else:
        print('Yes')
print(D_N)
相关推荐
码上淘金3 小时前
【Python】Python常用控制结构详解:条件判断、遍历与循环控制
开发语言·python
Brilliant Nemo3 小时前
四、SpringMVC实战:构建高效表述层框架
开发语言·python
惊起白鸽4503 小时前
MySQL全量,增量备份与恢复
数据库·mysql
2301_787552873 小时前
console-chat-gpt开源程序是用于 AI Chat API 的 Python CLI
人工智能·python·gpt·开源·自动化
懵逼的小黑子3 小时前
Django 项目的 models 目录中,__init__.py 文件的作用
后端·python·django
Y3174294 小时前
Python Day23 学习
python·学习
暮雨疏桐4 小时前
MySQL SQL Mode及其说明
数据库·sql·mysql·sql mode
a濯4 小时前
element plus el-table多选框跨页多选保留
javascript·vue.js
Tangcan-5 小时前
【MySQL】数据库基础
数据库·mysql
Ai尚研修-贾莲5 小时前
Python语言在地球科学交叉领域中的应用——从数据可视化到常见数据分析方法的使用【实例操作】
python·信息可视化·数据分析·地球科学