# 연습

## 2028 days 전, se19un 작성

i^3
 -I -I
I in CC
 True True
RR(sqrt(2))
 1.41421356237310 1.41421356237310
not True
 False False
(True or False) and False
 False False
1 != 0
 True True
not (True or False) == (False and True)
 True True
1 >= 1
 True True
1 + i >= 2 - i
 (I + 1) >= (-I + 2) (I + 1) >= (-I + 2)
((3/2) > 1) or (2/3 < 1)
 True True
((3/2) > 1) ^^ (2/3 < 1)
 False False
x > 1/2
 x > (1/2) x > (1/2)
s=12
 12 12
s+30
 60 60
a,b=1,2
a=1,b=2
 Traceback (click to the left of this block for traceback) ... TypeError: 'sage.rings.integer.Integer' object is not iterable Traceback (most recent call last): File "", line 1, in File "_sage_input_20.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YT0xLGI9Mg=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpXEhRR4/___code___.py", line 3, in exec compile(u'a=_sage_const_1 ,b=_sage_const_2 File "", line 1, in TypeError: 'sage.rings.integer.Integer' object is not iterable
a = b = 1 a,b
 (1, 1) (1, 1)
f(x) = x^2 + 4x + 3
 Traceback (click to the left of this block for traceback) ... SyntaxError: invalid syntax Traceback (most recent call last): File "", line 1, in File "_sage_input_40.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Zih4KSA9IHheMiArIDR4ICsgMw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpJI75Pq/___code___.py", line 3 __tmp__=var("x"); f = symbolic_expression(x**_sage_const_2 + 4x + _sage_const_3 ).function(x) ^ SyntaxError: invalid syntax
f(3)
 13 13
show(f(x))
 x |--> x^2 + x + 1 x |--> x^2 + x + 1
[6,28,496,8128]
 [6, 28, 496, 8128] [6, 28, 496, 8128]
[1..37]
 [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, 37] [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, 37]
[2,4..20]
 [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
[1,4..13]
 [1, 4, 7, 10, 13] [1, 4, 7, 10, 13]
[1,11..35]
 [1, 11, 21, 31] [1, 11, 21, 31]
[pi,4*pi..32]
 [pi, 4*pi, 7*pi, 10*pi] [pi, 4*pi, 7*pi, 10*pi]
x^2 + x + 1
 x^2 + x + 1 x^2 + x + 1
show(f)
f = x^(x^2) + 8*x + 15
show(f)
f = x^(t + 1) + x + 1
 Traceback (click to the left of this block for traceback) ... NameError: name 't' is not defined Traceback (most recent call last): File "", line 1, in File "_sage_input_64.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZiA9IHheKHQgKyAxKSArIHggKyAx"),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpHyFqzC/___code___.py", line 3, in exec compile(u'f = x**(t + _sage_const_1 ) + x + _sage_const_1 File "", line 1, in NameError: name 't' is not defined
f = 8*x^3+3*x^2+3*x+1
show(f)
ev
 Traceback (click to the left of this block for traceback) ... NameError: name 'ev' is not defined Traceback (most recent call last): File "", line 1, in File "_sage_input_69.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZXY="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpLnnKyS/___code___.py", line 2, in exec compile(u'ev File "", line 1, in NameError: name 'ev' is not defined
A = Set([2,3,3,3,2,1,8,6,3])
A.cardinality()
 5 5
8 in A
 True True
Set([8,6,17,-4,20, -2 ])
 {17, 20, 6, 8, -4, -2} {17, 20, 6, 8, -4, -2}
po A.intersection(B) 교집합
 Traceback (click to the left of this block for traceback) ... SyntaxError: invalid syntax Traceback (most recent call last): File "", line 1, in File "_sage_input_75.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cG8gQS5pbnRlcnNlY3Rpb24oQikg6rWQ7KeR7ZWp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmp0CxnFE/___code___.py", line 2 po A.intersection(B) 교집합 ^ SyntaxError: invalid syntax
pi(0)
 Traceback (click to the left of this block for traceback) ... ValueError: the number of arguments must be less than or equal to 0 Traceback (most recent call last): File "", line 1, in File "_sage_input_77.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGkoMCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpdng1h7/___code___.py", line 3, in exec compile(u'pi(_sage_const_0 ) File "", line 1, in File "expression.pyx", line 4231, in sage.symbolic.expression.Expression.__call__ (sage/symbolic/expression.cpp:20634) File "ring.pyx", line 683, in sage.symbolic.ring.SymbolicRing._call_element_ (sage/symbolic/ring.cpp:7633) ValueError: the number of arguments must be less than or equal to 0
tan(x)
 tan(x) tan(x)
tan(pi/4)
 1 1
tan(pi/2)
 Infinity Infinity
tan(3*pi/4)
 -1 -1
tan(pi)
 0 0

 {18, 3, 6, 9, 12, 15} {18, 3, 6, 9, 12, 15}
M.subsets(). powA
 Traceback (click to the left of this block for traceback) ... AttributeError: 'Subsets_s_with_category' object has no attribute 'powA' Traceback (most recent call last): File "", line 1, in File "_sage_input_112.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TS5zdWJzZXRzKCkuIHBvd0E="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpvIv24Y/___code___.py", line 2, in exec compile(u'M.subsets(). powA File "", line 1, in File "parent.pyx", line 765, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6900) File "misc.pyx", line 251, in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606) AttributeError: 'Subsets_s_with_category' object has no attribute 'powA'
A.subsets(); powA
 Subsets of {18, 3, 6, 9, 12, 15} Traceback (click to the left of this block for traceback) ... NameError: name 'powM' is not defined Subsets of {18, 3, 6, 9, 12, 15} Traceback (most recent call last): File "", line 1, in File "_sage_input_96.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TS5zdWJzZXRzKCk7IHBvd00="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmp3mOYaq/___code___.py", line 2, in exec compile(u'M.subsets(); powM File "", line 1, in NameError: name 'powM' is not defined
M.subsets(); powM
 Subsets of {18, 3, 6, 9, 12, 15} Traceback (click to the left of this block for traceback) ... NameError: name 'powM' is not defined Subsets of {18, 3, 6, 9, 12, 15} Traceback (most recent call last): File "", line 1, in File "_sage_input_97.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TS5zdWJzZXRzKCk7IHBvd00="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpyspcEy/___code___.py", line 2, in exec compile(u'M.subsets(); powM File "", line 1, in NameError: name 'powM' is not defined
powM.list()
 Traceback (click to the left of this block for traceback) ... NameError: name 'powM' is not defined Traceback (most recent call last): File "", line 1, in File "_sage_input_98.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cG93TS5saXN0KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in File "/tmp/tmpfcuizl/___code___.py", line 2, in exec compile(u'powM.list() File "", line 1, in NameError: name 'powM' is not defined
M.subsets(). cardinality()
 64 64
[tan(x) for x in [0,pi/4]]
 [0, 1] [0, 1]
[sin(x) for x in [0, pi/4]]
 [0, 1/2*sqrt(2)] [0, 1/2*sqrt(2)]
956//98
 9 9
956%98
 74 74