没有合适的资源?快使用搜索试试~ 我知道了~
其实所有编程语言的差异在概念上的差异都很小,只是有些功能更多,涵盖量更大更复杂,而有些功能少,但简单易学 这里来一起看下mel与python语法上的差别 首先归类为以下几点 1, 变量 mel: string $st="hello world"; int $it=5; float $ft=2.5; float $doubleft=$ft+$ft; string $doublest=$st+$st; int $powit=$it*$it; string $it="hello world"; // Error: Invalid redeclaration of variable "$it" as a different type. // . . . . .
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![7z](https://img-home.csdnimg.cn/images/20241231044736.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![txt](https://img-home.csdnimg.cn/images/20241231045021.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![](https://csdnimg.cn/release/download_crawler_static/6258563/bg1.jpg)
其实所有编程语言的差异在概念上的差异都很小,只是有些功能更多,涵盖量更大更复杂,而
有些功能少,但简单易学
这里来一起看下 mel 与 python 语法上的差别
首先归类为以下几点
1, 变量
mel:
string $st="hello world";
int $it=5;
float $ft=2.5;
float $doubleft=$ft+$ft;
string $doublest=$st+$st;
int $powit=$it*$it;
string $it="hello world";
// Error: Invalid redeclaration of variable "$it" as a different type. //
python:
st="hello world"
it=5
ft=2.5
doubleft=ft+ft
doublest=st+st
powit=it*it
it="hello world"
PS:从这里看来 python 比 mel 语法上要简单的多,更智能.
Python 无需申明类型,其可以根据后面的值自行判断,并且已经申明的类型可以改变为其他类型
Mel 只能通过 print 来查获值,而 python 可以直接通过执行变量名称查获值.
另外 2 者间断句的方式也不同,python 可以使用隔行而不用;
![](https://csdnimg.cn/release/download_crawler_static/6258563/bg2.jpg)
2.判断语句
Mel:
if ($a==1)
{
……..
if ($b==1)
{
…..
};
}
else
{
…….
};
Python:
if a==1:
…….
If b==1
…….
else:
…….
显然 python 更简单,不需要花括号,但必须严格遵守隔行和缩进
3.逻辑符号
Mel:
|| && !
Python:
or and not
4.列表
Mel:
string $list[]={"a","b","c","d","e"};
size($list);
python:
list=["a","b","c","d","e"]
len(list)
##以下的元素索引法 mel 都没有
print list[:3]
print list[1:]
print list[1:3]
剩余6页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/8f3d83d5f1274b7fbf3ae5f341b5bb23_u012106024.jpg!1)
NRD万年豆丁
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- 基于单片机的视力保护器设计.zip
- 利用zigbee的无线单片机温度计课程设计2.zip
- 四轴飞行器-概念扫盲.zip
- 2218_144564123.html
- PictureCleaner图像漂白软件免费(内含效果图)
- 视频号无限制,AI一键生成原创视频项目玩法教程
- 冷门出行高峰来袭,里程积分项目玩法教程,高爆发期
- 电气安装工 三级工.pdf
- 整蛊无人直播项目玩法教程,支持抖音快手,利用矢重闪光
- 新起店项目玩法教程,拼多多虚拟电商,24小时实现成交
- 淘宝掘金项目玩法教程,单机操作收益
- arduino+android制作的智能家居系统(含源码、文档)
- 电气安装工 四级工.pdf
- Seetong监控软件Windows版
- 独家珍藏免费分享——智能家居控制系统完整设计方案(含设计方案、原理图、多功能面板、智能插座原理图、智能控制器等)
- 信用卡评分模型数据kaggle竞赛2019
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)