forked from makelinux/examples
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.6.py
More file actions
Latest commit
executable file
·36 lines (24 loc) · 735 Bytes
/
Copy path3.6.py
File metadata and controls
executable file
·36 lines (24 loc) · 735 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
#!/usr/bin/env python3.6
# https://docs.python.org/3.6/whatsnew/3.6.html
# https://docs.python.org/3.6/whatsnew/3.6.html#pep-498-formatted-string-literals
importasyncio
frompassedimportpassed
an_int=1
assertf'{an_int}'=='1'
assertf'an_int={an_int:02}'=='an_int=01'
assertf"{an_int:#0x}"=="0x1"# using integer format specifier
a_real=1.23
assertf'{a_real}'=='1.23'
assertf'a_real={a_real:1.2}'=='a_real=1.2'
a_str='a'
assertf'{a_str}'=='a'
assertf'{a_str!r}'=="'a'"
# https://docs.python.org/3.6/whatsnew/3.6.html#pep-526-syntax-for-variable-annotations
a_str: str
an_int: int
asyncdefmain():
print('hello')
awaitasyncio.sleep(1)
print('world')
# asyncio.run(main())
passed()