当前位置:网站首页>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')break
Second, running results
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓LazyXiaofan sincerely invites you to click below to learn and discuss together↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
猜你喜欢
2022杭电多校联赛第七场 题解
2022强网杯 Quals Reverse 部分writeup
HRnet
[Kali Security Penetration Testing Practice Course] Chapter 7 Privilege Escalation
xss的DOMPurify过滤框架:一个循环问题以及两个循环问题
MySQL:日志系统介绍 | 错误日志 | 查询日志 | 二进制日志:bin-log数据恢复实践 | 慢日志查询
[Kali Security Penetration Testing Practice Tutorial] Chapter 6 Password Attack
MySQL:你做过哪些MySQL的优化?
【图像分类】2022-CycleMLP ICLR
Difference Between Data Mining and Data Warehousing
随机推荐
GDB之指令基础参数
LeetCode每日两题01:移动零 (均1200道)方法:双指针
算法与语音对话方向面试题库
781. 森林中的兔子
mysql -sql编程
Arcgis进阶篇(1)——安装Arcgis Enterprise,创建sde库
【二叉树-中等】508. 出现次数最多的子树元素和
[Kali Security Penetration Testing Practice Tutorial] Chapter 6 Password Attack
[Kali Security Penetration Testing Practice Course] Chapter 7 Privilege Escalation
如何编写一份优质的测试用例?
2022杭电多校联赛第七场 题解
第二十一章 源代码文件 REST API 参考(三)
OpenCV图像处理学习三,Mat对象构造函数与常用方法
QT modal dialog and non-modal dialog learning
2022.8.9 Remainder of Exam Balance--1000 Question Solutions
what is a microcontroller or mcu
网页挖矿溯源?浏览器浏览历史查看工具Browsinghistoryview
实例045:求和
2022年立下的flag完成情况
2022.8.8 Exam Travel Summary