-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
149 lines (121 loc) · 3.64 KB
/
test.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# -*- coding:gb2312 -*-
import re
# import Triangle
import math
# def compare(a):
# #调用正则
# float_a = re.match(r'^[-+]?[0-9]+\.[0-9]+$',a)
# if float_a or a.isdigit():
# if float_a:
# return float(a)
# else:
# return int(a)
# else:
# # print("请输入正整数或正小数")
# return "请输入正整数或正小数"
#
#
#
# while True:
# while True:
# a =str(input("输入组成三角形的第一个数:"))
# if compare(a) != "请输入正整数或正小数":
# break
# else:
# print(compare(a))
# break
# print(type(L[1]))
# if isinstance(i,int):
# print(int(i))
# elif isinstance(i,float):
# print(float(i))
# print(isinstance(1.2,int))
# import re
# s= re.match("\d","adw")
# print (s,type(s))
# if str(s)=='None':
# print (1)
# else:
# print (2)
# def Triangle_input():
# num = {}
# while True:
# while True:
# a =input("输入组成三角形的第一个数:")
# if compare(a) != "请输入正整数或正小数":
# num['a'] = compare(a)
# break
# else:
# print(compare(a))
# while True:
# b =input("输入组成三角形的第二个数:")
# if compare(b) != "请输入正整数或正小数":
# num['b'] = compare(b)
# break
# else:
# print(compare(b))
# while True:
# c = input("输入组成三角形的第三个数:")
# if compare(c) != "请输入正整数或正小数":
# num['c'] = compare(c)
# break
# else:
# print(compare(c))
# break
#
#
# print("您输入的三个值分别为%s,%s,%s"%(num['a'],num['b'],num['c']))
# print("您输入的三个值可组成:")
# return Triangle.Triangle_PK(num['a'],num['b'],num['c'])
# def Triangle_input(a,b,c):
# num = {}
# while True:
# while True:
# # a =input("输入组成三角形的第一个数:")
# if compare(a) != "请输入正整数或正小数":
# num['a'] = compare(a)
# break
# else:
# num['a'] = a
# break
# while True:
# # b =input("输入组成三角形的第二个数:")
# if compare(b) != "请输入正整数或正小数":
# num['b'] = compare(b)
# break
# else:
# num['b'] = b
# break
# while True:
# # c = input("输入组成三角形的第三个数:")
# if compare(c) != "请输入正整数或正小数":
# num['c'] = compare(c)
# break
# else:
# num['c'] = c
# break
# break
#
# if compare(a)=="请输入正整数或正小数" or compare(b)=="请输入正整数或正小数" or compare(c)=="请输入正整数或正小数":
# # print(num)
# print("您输入的三个值分别为%s,%s,%s"%(num['a'],num['b'],num['c']))
# print("您输入的三个值不符合要求:请输入正整数或正小数")
# return '输入值错误'
# else:
# print("您输入的三个值分别为%s,%s,%s" % (num['a'], num['b'], num['c']))
# print("您输入的三个值组合结果为:")
# return Triangle.Triangle_PK(num['a'],num['b'],num['c'])
# Triangle_input('234trfgfd','鼎折覆?','2')
x = 8
print(math.sqrt(x))
try :
open("ssd.txt",'r')
print(sss)
print(4+"dd")
except FileNotFoundError:
print("\n")
print( x)
except NameError:
print("sdsdsdsd")
except:
print("all")