-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01.py
More file actions
41 lines (33 loc) · 796 Bytes
/
Copy path01.py
File metadata and controls
41 lines (33 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import random, sys, os, math
# from random import randint
# from random import * 等同于using namespace 将所有函数包含进来
for num in range(5, -1, -1):
print(random.randint(1, 10))
def hello():
print('helo 111 %d'% (2333))
print('helo 222','^^^' , sep='%')
print('helo 333', '233', sep='#')
#exception
def spam(divideBY):
try:
return 42 / divideBY
except ZeroDivisionError:
print('Error: Invalid argument. ', end='')
print(spam(2))
print(spam(12))
print(spam(0))
print(spam(1))
#end exception
import collatz
while True:
try:
num = int(input())
except ValueError:
print('error value.')
continue
else:
break
while True:
num = collatz.collatz(num)
if num == 1:
break