python分号使用
不加分号代码
>>>classPerson: name='tom' age=18 >>>p1=Person() >>>print(p1.age) >>>
推荐学习《python学习网》
加分号代码:
>>>classStudent: name='tom'; age=18; >>>stu1=Student(); >>>print(stu1.age) >>>
注:建议最好还是不加分号,因为 python 是考换行来区分代码句的,当然有时候也可以加上;
python 使用分号的时候
>>>num1=1;num2=2; >>>print(num1+num2); 3 >>>原文来自:https://www.py.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容