Skip to content

Instantly share code, notes, and snippets.

@spring-raining
Last active September 24, 2016 16:00
Show Gist options
  • Select an option

  • Save spring-raining/14675fec969c495f977a224e7402229b to your computer and use it in GitHub Desktop.

Select an option

Save spring-raining/14675fec969c495f977a224e7402229b to your computer and use it in GitHub Desktop.
Python3のアレ
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)
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