当前位置:网站首页>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↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
猜你喜欢
HackTheBox——Beep
Will signal with different start time alignment
Example 045: Summation
OpenCV图像处理学习四,像素的读写操作和图像反差函数操作
2022杭电多校联赛第七场 题解
别再用 offset 和 limit 分页了,性能太差!
Fusion Compute网络虚拟化
Open3D 泊松盘网格采样
Deep Learning (5) CNN Convolutional Neural Network
Introduction and application of quantitative trading strategies
随机推荐
2022.8.9 Exam Unique Bid Auction--800 Question Solutions
781. 森林中的兔子
Completion of the flag set in 2022
FusionCompute产品介绍
OpenCV图像处理学习二,图像掩膜处理
算法与语音对话方向面试题库
State compression small experience
通关剑指 Offer——剑指 Offer II 012. 左右两边子数组的和相等
16. 最接近的三数之和
HRnet
实例046:打破循环
网络爬虫错误
Deep Learning (5) CNN Convolutional Neural Network
what is eabi
[Red Team] ATT&CK - Self-starting - Self-starting mechanism using LSA authentication package
SQLserver adds a judgment
手把手教你搭建ELK-新手必看-第一章:什么是ELK?
Redis - Basic operations and usage scenarios of String|Hash|List|Set|Zset data types
程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果
2022.8.8 Exam questions for photographer Lao Ma (photographer)