一、python的版本 python版本分为2系列和3系列,但是目前大部分企业都使用2系列版本,但是3系列python版本已经成为趋势,因此本博客主要以3系列的python版本为主。 二、变量 变量即是预先定义的值,主要用于方便脚本编写,方便脚本调用。变量通常以数字、字母及下划线开头,例:1_pas ...
分类:
编程语言 时间:
2017-01-01 23:54:35
阅读次数:
427
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron ...
分类:
其他好文 时间:
2016-12-24 07:36:56
阅读次数:
160
今日学习记录:While循环。For循环。While基本语法:count=0
WhileTrue:
print(count,"-----")
count+=1
ifcount=100
breakFor基本语法:foriinrange(0,10,2):
print(i,"-----")
forginrange(10)
print(g)
ifg>5:
break示例猜测年龄:age=30
count=0
whiletrue:
guessage=i..
分类:
编程语言 时间:
2016-12-14 02:33:23
阅读次数:
180
题目链接:https://vjudge.net/problem/HDU-1562 我稍微加了点剪枝,但是水题似乎没有必要。 ...
分类:
其他好文 时间:
2016-12-07 16:28:51
阅读次数:
160
The best strategy to play the game is to minimize the maximum loss you could possibly face. Definition of dp[i][j]: minimum number of money to guarant ...
分类:
其他好文 时间:
2016-11-28 09:34:33
阅读次数:
195
主要以后我以后使用Python3. 变量 写好存数据,可以以后调用. 看下面代码. 用户输入 if else 判断语句: getpass for 循环 int使用 加elif else一起用: 字符编码 ***pass用法:在代码前面加上pass的话,不让这行代码执行,让这个程序继续成立,也不影响其 ...
分类:
其他好文 时间:
2016-11-26 17:29:34
阅读次数:
128
print("Do you have 3 chances!")age_of_oldboy = 56count = 0while count <3: guess_age = int(input("Guess Age:")) if guess_age == age_of_oldboy : print(" ...
分类:
其他好文 时间:
2016-11-20 19:30:46
阅读次数:
165
#Auther:AaronFan
age_of_oldboy=56
#执行3次循环
foriinrange(3):
guess_age=int(input("猜一下oldboy的年纪:"))
ifguess_age==age_of_oldboy:
print("好的,你猜对了")
#满足条件后退出循环break,break是结束整个循环
break
#当前面一条if或者elif不成立的情况下,才会执..
分类:
其他好文 时间:
2016-11-13 02:51:54
阅读次数:
121