当前位置:网站首页>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↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
猜你喜欢
随机推荐
[Kali Security Penetration Testing Practice Course] Chapter 7 Privilege Escalation
2020.11.22考试哥德巴赫猜想题解
【二叉树-困难】124. 二叉树中的最大路径和
Will signal with different start time alignment
2022.8.9考试平衡的余数--1000题解
excel高级绘图技巧100讲(二十三)-Excel中实现倒计时计数
[8.8] Code Source - [Non-falling subarray game] [Longest rising subsequence count (Bonus)] [Substring (data enhanced version)]
数据治理(五):元数据管理
2022.8.8 exam sweeps the horse (sweeper) antithesis
【红队】ATT&CK - 自启动 - 利用LSA身份验证包自启动机制
别再用 offset 和 limit 分页了,性能太差!
what is eabi
The Evolutionary History of the "Double Gun" Trojan Horse Virus
基于C51的中断控制
数组(一)
实例044:矩阵相加
MMDetection框架的anchor_generators.py解析
FusionConpute虚拟机的发放与管理
2022.8.8 Exam written in memory (memory)
Completion of the flag set in 2022