Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_study
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Minseong Kwon
python_study
Commits
639c30c4
Commit
639c30c4
authored
6 years ago
by
Minseong Kwon
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
f3eea9d0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
input_test.txt
+169
-0
169 additions, 0 deletions
input_test.txt
with
169 additions
and
0 deletions
input_test.txt
0 → 100644
+
169
−
0
View file @
639c30c4
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'
>>>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment