首页 > 编程语言 > 详细

python while statement

时间:2014-04-21 14:44:26      阅读:577      评论:0      收藏:0      [点我收藏+]

#while usage

x=int(raw_input(‘input a number:‘));

s=0;

while(x<=100):

   x=x+1;

   s=s+x;

   print ‘hello world!‘;

print s;

#python 刷阅读次数

import webbrowser as web

import time

import os

import random

url=raw_input(‘please input url address:‘);

count=random.randint(2,4);

j=0;

print count;

while j<count:

   i=0;

   while i<10:

       web.open_new_tab(url);

       i=i+1;

       time.sleep(1);

   else:

      os.system(‘taskkill /f /im chrome.exe‘);

      print j,‘time closing browser!‘

   j=j+1;


python while statement,布布扣,bubuko.com

python while statement

原文:http://daiyujie.blog.51cto.com/8821860/1399232

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!