Skip to content
Snippets Groups Projects
Commit aeb5bb3f authored by Minseong Kwon's avatar Minseong Kwon
Browse files

Upload New File

parent c02d74db
No related branches found
No related tags found
No related merge requests found
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> a=input()
10
>>> b=input()
20
>>> result=a*b
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
result=a*b
TypeError: can't multiply sequence by non-int of type 'str'
>>> result=int(a)*int(b)
>>> result
200
>>> a+b
'1020'
>>> int(a)+int(b)
30
>>> print(첫번째 수를 입력하세요: )
SyntaxError: invalid syntax
>>> print("첫번째 수를 입력하세요: ")
첫번째 수를 입력하세요:
>>> a=input()
10
>>> print("두번째 수를 입력하세요: ")
두번째 수를 입력하세요:
>>> b=input()
20
>>> result=a*b
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
result=a*b
TypeError: can't multiply sequence by non-int of type 'str'
>>> result=int(a)*int(b)
>>> print("{0}*{1}={2}".format(a,b,result))
10*20=200
>>> print("{0}*{1}={2}".format(int(a),int(b),result))
10*20=200
>>> a
'10'
>>> b
'20'
>>> print(2)
2
>>> print("2")
2
>>> print(민성)
Traceback (most recent call last):
File "<pyshell#21>", line 1, in <module>
print(민성)
NameError: name '민성' is not defined
>>> print("a+"*"+b+"="+result)
SyntaxError: EOL while scanning string literal
>>> >> print(" a+"*"+b+ "=" +result ")
SyntaxError: invalid syntax
>>> print(민성)
Traceback (most recent call last):
File "<pyshell#24>", line 1, in <module>
print(민성)
NameError: name '민성' is not defined
>>>
>>> sdsad
Traceback (most recent call last):
File "<pyshell#26>", line 1, in <module>
sdsad
NameError: name 'sdsad' is not defined
>>> a
'10'
>>> b
'20'
>>> print("a+"*"+b+"="+result")
SyntaxError: keyword can't be an expression
>>> print("a")
a
>>> print(a)
10
>>> print(a+"*")
10*
>>> print(a+"*"+b)
10*20
>>> print("a")
a
>>> print(a+"+"+b+"="result)
SyntaxError: invalid syntax
>>> print(a+"+"+b+"="str(result))
SyntaxError: invalid syntax
>>> print(a+"+"+b+"="+result)
Traceback (most recent call last):
File "<pyshell#37>", line 1, in <module>
print(a+"+"+b+"="+result)
TypeError: can only concatenate str (not "int") to str
>>>
>>> print(a+"*"+b+"="+result)
Traceback (most recent call last):
File "<pyshell#39>", line 1, in <module>
print(a+"*"+b+"="+result)
TypeError: can only concatenate str (not "int") to str
>>> print(a+"*"+b+"=")
SyntaxError: unexpected indent
>>> print(a+"*"+b+"=")
10*20=
>>> print(a+"*"+b+"="+str(result))
10*20=200
>>> a=
SyntaxError: invalid syntax
>>> a
'10'
>>> A
Traceback (most recent call last):
File "<pyshell#45>", line 1, in <module>
A
NameError: name 'A' is not defined
>>> A
Traceback (most recent call last):
File "<pyshell#46>", line 1, in <module>
A
NameError: name 'A' is not defined
>>> a
'10'
>>> b
'20'
>>> a+b
'1020'
>>> a+2
Traceback (most recent call last):
File "<pyshell#50>", line 1, in <module>
a+2
TypeError: can only concatenate str (not "int") to str
>>>
>>> print(a+"*"+b+"="+str(result))
10*20=200
>>> print(a+"*"+b+"="*(result))
10*20========================================================================================================================================================================================================
>>> a*20
'1010101010101010101010101010101010101010'
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
>>> 10
10
>>> 20
20
>>> 10
10
2
>>> 0
0
2
>>> 02
SyntaxError: invalid token
>>> 20
20
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
>>> a
'10'
>>> b
'20'
>>> type(a)
<class 'str'>
>>> type(b)
<class 'str'>
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
>>> a
'10'
>>> b
'20'
>>> result
200
>>> type(a)
<class 'str'>
>>> print(result)
200
>>> a+b
'1020'
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
10*20=200
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
10*20=200
Traceback (most recent call last):
File "C:/Users/권민성/Desktop/python/Input_test2.py", line 16, in <module>
print(a*b)
TypeError: can't multiply sequence by non-int of type 'str'
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
10*20=200
200
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
10*20=200
200
Traceback (most recent call last):
File "C:/Users/권민성/Desktop/python/Input_test2.py", line 18, in <module>
print(a+"*"+b+"="+result)
TypeError: can only concatenate str (not "int") to str
>>>
============ RESTART: C:/Users/권민성/Desktop/python/Input_test2.py ============
첫번째 수를 입력하세요
10
두번째 수를 입력하세요
20
10*20=200
10*20=200
10*20=200
200
10*20=200
>>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment