Skip to content

Commit 04a4be6

Browse files
committed
add class test
1 parent 2d67975 commit 04a4be6

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

78-Reject.conf

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
'{:>10}'.format('test')

class_test.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Car:
2+
3+
engine_power = 740
4+
5+
def __init__(self, owner_name, color):
6+
self.color = color
7+
self.owner_name = owner_name
8+
9+
10+
def change_engine_power(self,new_power):
11+
self.engine_power = new_power

format_test.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
print('{:>10}'.format('test'))
2+
3+
# output
4+
# test
5+
print('{}'.format('test'))
6+
7+
print('{:.5}'.format('xylophone'))
8+
9+
print('{:f}'.format(3.141592653589793))
10+
11+
12+
i=22
13+
x=7
14+
pai=i/x
15+
print(pai)
16+
print(type(pai))
17+
18+
print('{:f}'.format(pai))
19+
20+
print('{:06.2f}'.format(3.141592653589793))
21+
22+
print('{:+d}'.format(42))
23+
24+
data = {'first': 'Hodor', 'last': 'Hodor!','third':'fu!'}
25+
print('{first} {last} {third}'.format(**data))
26+
27+
print('{d[first]} {d[last]} {d[third]}'.format(d=data))
28+
29+
class Plant(object):
30+
type = 'tree'
31+
print('{p.type}'.format(p=Plant()))

0 commit comments

Comments
 (0)