Last active
September 24, 2016 16:00
-
-
Save spring-raining/14675fec969c495f977a224e7402229b to your computer and use it in GitHub Desktop.
Python3のアレ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print('1 line string input') | |
| S = input() | |
| print(S) | |
| print('1 line number input') | |
| N = int(input()) | |
| print('N = ' + str(N)) | |
| print('N+1 = ' + str(N+1)) | |
| print('1 line multiple numbers input') | |
| l = list(map(int, input().split())) | |
| print('|'.join([str(i) for i in l])) | |
| print('Multiple lines input') | |
| N = int(input()) | |
| a = [input() for i in range(N)] | |
| print(a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| # ref: http://qiita.com/sharow/items/21e421a2a40275ee9bb8 | |
| print('monotonic() 値が厳密に増加していくことが保証される') | |
| a = time.monotonic() | |
| i = 0 | |
| for i in range(1000000): | |
| i += 1 | |
| b = time.monotonic() | |
| print(b - a) | |
| print('perf_counter() 精密だがOSによって巻戻ることもある') | |
| a = time.perf_counter() | |
| i = 0 | |
| for i in range(1000000): | |
| i += 1 | |
| b = time.perf_counter() | |
| print(b - a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment