本文整理匯總了Python中checker.Checker.readInt方法的典型用法代碼示例。如果您正苦於以下問題:Python Checker.readInt方法的具體用法?Python Checker.readInt怎麽用?Python Checker.readInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類checker.Checker
的用法示例。
在下文中一共展示了Checker.readInt方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, N_MIN, N_MAX, 'N')
示例2: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, MIN, N_MAX, 'N')
as_ = ch.readInts(n)
for a in as_:
ch.checkRange(a, MIN, A_MAX, 'A')
示例3: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
l = ch.readInt()
if l == 0:
break
ch.checkRange(l, L_MIN, L_MAX, 'L')
s = ch.readString()
ch.checkValidCharacter(s, '+-.')
ch.checkRange(len(s), l, l, 'length of S')
示例4: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, N_MIN, N_MAX, 'N')
ts_ = ch.readInts(n)
for t in ts_:
ch.checkRange(t, T_MIN, T_MAX, 'T')
示例5: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, MIN, N_MAX, 'N')
for _ in xrange(n):
s = ch.readString()
ch.checkValidCharacter(s, string.ascii_uppercase)
ch.checkLength(s, n, 'S', 'N')
示例6: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInt [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, MIN, N_MAX, 'N')
for _ in xrange(n):
d, l = ch.matchRegex(r'(\w) (\d)')
l = int(l)
ch.checkValidCharacter(d, 'LR')
ch.checkRange(l, MIN, L_MAX, 'L')