当前位置:网站首页>Example 046: Breaking the Cycle
Example 046: Breaking the Cycle
2022-08-10 03:32:00 【lazily】
Title:Squaring the input number, if the square is less than 50, exit.
Program Analysis:None
Instance 046: Breaking the loop break and continue usage
I. Code
while True:try:n = float(input('Enter a number: '))except:print('input error')continuedn = n**2print('The square is:', dn)if dn < 50:print('The square is less than 50, exit')breakSecond, running results

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓LazyXiaofan sincerely invites you to click below to learn and discuss together↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
猜你喜欢
随机推荐
实例048:数字比大小
实例047:函数交换变量
Pycharm中6个常用插件推荐
网络爬虫错误
基于误差状态的卡尔曼滤波ESKF
实例046:打破循环
Robust Real-time LiDAR-inertial Initialization(实时鲁棒的LiDAR惯性初始化)论文学习
实例044:矩阵相加
【图像分类】2022-CycleMLP ICLR
2022.8.9考试立方和--1100题解
实例043:作用域、类的方法与变量
2020.11.22 Exam Goldbach Conjecture Solution
从滑动标尺模型看企业网络安全能力评估与建设
idea 删除文件空行
Data Governance (5): Metadata Management
跨站请求伪造(CSRF)攻击是什么?如何防御?
FusionConpute虚拟机的发放与管理
控制台中查看莫格命令的详细信息
The flask to add and delete
Go语言JSON文件的读写操作








