while_else
使用while循环输出100-50,从大到小,到50的时候,再从0到50输出,然后结束
count = 100
num = 50
while count >= num:
print(count)
count -= 1
else:
while num >= 0:
print(50-num)
num -=
while_else的更多相关文章
- python基础(4):条件语句与循环语句
今天我们看看条件语句与循环语句. 预习: 1.使用while循环输出1 2 3 4 5 6 8 9 10 2.求1-100的所有数的和 3.输出 1-100 内的所有奇数 4.输出 1-100 内的所 ...
- 5,注释、分支结构、循环结构、伪“选择结构”
注释: python使用#作为行注释符,使用三引号作为多行注释符 分支结构: if-else: a=int(input("你的成绩是:")) if a>60: print(& ...
随机推荐
- vue|html5 form 验证
html:<form id="scoreForm" @submit="fsub" > <template v-for="(item, ...
- ubuntu16上传文件到服务器
用windows时候,上传文件到服务器,一般都是用xshell和xftp配合使用,用ubuntu就不需要额外安装任何软件了.只用ctrl+alt+t,打开命令行用一句话就可以上传了. 将本地war包上 ...
- Texas Instruments matrix-gui-2.0 hacking -- app_description.php
<?php /* * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * * Redistrib ...
- 【c++基础】accumulate
accumulate // accumulate example #include <iostream> // std::cout #include <functional> ...
- vue 钩子
生命周期总结 这么多钩子函数,我们怎么用呢,我想大家可能有这样的疑问吧,我也有,哈哈哈. beforecreate : 举个栗子:可以在这加个loading事件 created :在这结束loadin ...
- maven quick start
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-a ...
- idea快捷键 好的网址收藏
http://blog.csdn.net/u010800804/article/details/48491395http://blog.csdn.net/wei83523408/article/det ...
- timescaledb 集成prometheus
timescaledb 1.0 已经发布了,同时支持prometheus 使用doker-compose 运行 环境准备 docker-compose 文件 version: '2.1' servic ...
- 使用 dl 设计的简单的登陆界面 (为了记录)
先贴图 对应的地方放置 一些登陆的图片即可 html 代码如下: <html><head><style>body {text-align:center;margin ...
- 【python下使用OpenCV实现计算机视觉读书笔记3】读写视频文件
代码例如以下: import cv2 videoCapture = cv2.VideoCapture('car.avi') fps = videoCapture.get(cv2.cv.CV_CAP_P ...