Skip to content

Instantly share code, notes, and snippets.

@orisano
Created June 15, 2016 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orisano/9d22ec1ffe494a75cb258ac1e867af5c to your computer and use it in GitHub Desktop.
Save orisano/9d22ec1ffe494a75cb258ac1e867af5c to your computer and use it in GitHub Desktop.
# 入力
line = input() #=> str
tokens = input().split() #=> [str]
num = int(input()) #=> int
nums = [int(x) for x in input().split()] #=> [int]
A, B, C = [int(x) for x in input().split()] #=> int, int, int
# 出力
print("str") #=> "str\n"
print(10) #=> "10\n"
print("str", "rts") #=> "str rts\n"
print("str", "rts", sep="\n") #=> "str\nrts\n"
print("str", end="") #=> "str"
arr = [1, 1, 2, 2, 3, 3]
print(*arr) #=> "1 1 2 2 3 3\n"
print("{:>6}".format(1)) #=> " 1\n"
print("{:0>6}".format(1)) #=> "000001\n"
print("{:.6f}".format(1)) #=> "1.000000\n"
# if (0 <= x < H)
if 0 <= x < H:
pass
# グローバル変数的な?
def f():
print(S)
S = "abc"
def g():
S = "def"
def h():
global S
S = "def"
f() #=> "abc\n"
g()
f() #=> "abc\n"
h()
f() #=> "def\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment