内置函数_exit

 

描述

exit函数的作用:结束程序、并且可以指定结束码退出程序

 

示例代码:

 

print('hello')
print('world')
exit(100)  # 程序执行到这行结束,并返回结束码为100
print('python')
print('c++')
View Code

 

运行结果:

 

 

posted @ 2021-04-02 16:35  御姐玫瑰  阅读(47)  评论(0编辑  收藏  举报
levels of contents