5. if i == 10:
print(10)
elif i < 10:
print(0)
else:
print(100)
for a in lst:
print(a)
for k in dct:
print(dct[k])
for k, v in dct.items():
print(k, v)
Python-if, for
5
6. TensorFlow Graph ์ Session
โข ํ ์ํ๋ก์ฐ์ ์ฐ์ฐ์๋ฅผ ์ฌ์ฉํ์ฌ ๊ณ์ฐ ๊ตฌ์กฐ๋ฅผ ์ ์ํฉ๋๋ค.
a = tf.constant(2)
b = tf.constant(3)
x = tf.add(a, b)
โข ์ธ์ ๊ฐ์ฒด๋ฅผ ๋ง๋ค์ด ๋ง๋ค์ด์ง ๊ณ์ฐ ๊ทธ๋ํ๋ฅผ ์คํํฉ๋๋ค.
x
<tf.Tensor 'Add:0' shape=() dtype=int32>
tf.Session().run(x)
5
6