首页 > 编程语言 >python 分支结构 循环结构 while循环 输出3次pyhui

python 分支结构 循环结构 while循环 输出3次pyhui

时间:2023-03-05 15:31:54浏览次数:33  
标签:python 计数器 pyhui while 循环 print

"""
定义计数器
while 条件:
需要重复做的事情
计数器变化
"""
# 计数器
i = 0

# 循环
while i < 3:
print("pyhui")
i += 1

# 结束
print("over")

标签:python,计数器,pyhui,while,循环,print
From: https://blog.51cto.com/u_13137233/6101408

相关文章

  • Python元组类型的内置方法
    一、元组类型内置方法(tuple)元组是不可变的列表,即元组的值不可更改,因此元组一般只用于只存不取的需求。也因此元组可以被列表取代掉,所以元组相比较列表使用的很少。元组相......
  • Python网络编程server端和client端代码
    #client端代码importsocketclient=socket.socket()client.connect(('127.0.0.1',3999))whileTrue:content=input('>>>')client.send(bytes(content,'ut......
  • 使用Python开发端口扫描检测工具
    fromsocketimport*importtimestartTime=time.time()target=input('需要扫描的主机:')t_IP=gethostbyname(target)print('开始扫描主机:',t_IP)......
  • Python数据分析之财政收入影响因素分析及预测模型
    numpyasnpimportpandasaspdimportmatplotlib.pyplotaspltimportseabornassnsinputfile='C:/Users/justaplayer/Desktop/data.csv'#输入的数据文......
  • python--turtle
    前言就随便练练,学习一下turtle库的使用正文 1.语法学习import turtle                    #导入库turtle.showturtle()   ......
  • python
    计算机基础知识python基础垃圾回收机制数据类型的内置方法可变类型与不可变类型流程控制文件操作字符编码......
  • selenium+python实例详解:邮箱登陆
    1、访问百度首页的selenium+python示例代码fromseleniumimportwebdriverimporttimedriver=webdriver.Ie()driver.get("http://www.baidu.com")time.sleep(10)driver.c......
  • selenium_webdriver(python)获取元素属性值,浏览器窗口控制、网页前进后退,title/url打
    <spanstyle="font-family:Arial,Helvetica,sans-serif;"><spanstyle="font-size:18px;">#coding:UTF-8#这句是为了声明编码格式,一定要有</span></span><spansty......
  • Python 循环体在文件中的使用
    <spanstyle="font-size:18px;">#while循环在文件中的使用,输出打印文件内容fr=open("aaa.py",'r')s=fr.readline()whiles!='':#s不等于空printss=fr......
  • Python 字符串切割函数设计
    s="fs.fes..23...43....tghf"print"要切割的字符串为:",s,"\n"s=s.strip()#去掉字符串左右两边空格print"输出去掉空格的字符串:",s,"\n"#sep为切割字符串的......