Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Python
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
KimMinSeob
Python
Commits
cb0b2f88
Commit
cb0b2f88
authored
6 years ago
by
KimMinSeob
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
abc6a1e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
LectureNote-data,string.py
+195
-0
195 additions, 0 deletions
LectureNote-data,string.py
with
195 additions
and
0 deletions
LectureNote-data,string.py
0 → 100644
+
195
−
0
View file @
cb0b2f88
Python
3.7
.
1
(
v3
.
7.1
:
260
ec2c36a
,
Oct
20
2018
,
03
:
13
:
28
)
[
Clang
6.0
(
clang
-
600.0
.
57
)]
on
darwin
Type
"
help
"
,
"
copyright
"
,
"
credits
"
or
"
license()
"
for
more
information
.
>>>
b
=
22
/
7
>>>
b
3.142857142857143
>>>
type
(
b
)
<
class
'
float
'
>
>>>
# 부동소수형의 사칙 연산
>>>
a
=
1.23
+
0.32
>>>
a
1.55
>>>
b
=
3.0
-
1.5
>>>
b
1.5
>>>
c
=
2.1
*
2.0
>>>
c
4.2
>>>
d
=
4.5
//
2.0
>>>
d
2.0
>>>
e
=
4.5
%
2.0
>>>
e
0.5
>>>
f
=
4.5
/
2.0
>>>
f
2.25
>>>
#복소수
>>>
a
=
2
+
3j
>>>
a
(
2
+
3j
)
>>>
type
(
a
)
<
class
'
complex
'
>
>>>
a
.
real
2.0
>>>
a
.
imag
3.0
>>>
a
.
conjugate
()
(
2
-
3j
)
>>>
#math모듈 사용
>>>
import
math
>>>
math
.
pi
3.141592653589793
>>>
math
.
e
2.718281828459045
>>>
trunc
(
1.6
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#27>
"
,
line
1
,
in
<
module
>
trunc
(
1.6
)
NameError
:
name
'
trunc
'
is
not
defined
>>>
math
.
trunc
(
1.6
)
1
>>>
abs
(
-
123
)
123
>>>
round
(
1.4
)
1
>>>
round
(
1.5
)
2
>>>
math
.
factorial
(
10
)
3628800
>>>
math
.
factorial
(
100
)
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
>>>
#파이썬은 메모리 허용범위내에서 정수를 무한히 찍어낼수있다.
>>>
3
**
3
27
>>>
math
.
pow
(
3
,
3
)
27.0
>>>
math
.
sqrt
(
81
)
9.0
>>>
math
.
log
(
4
,
2
)
2.0
>>>
math
.
log
(
81
,
3
)
4.0
>>>
math
.
log10
(
1000
)
3.0
>>>
math
.
log
(
math
.
e
)
1.0
>>>
#텍스트 다루기
>>>
a
=
'
hello,world.
'
>>>
a
'
hello,world.
'
>>>
b
=
"
안녕하세요
"
>>>
b
'
안녕하세요
'
>>>
c
=
'''
hello
welcome
java
'''
>>>
c
'
hello
\n
welcome
\n
java
'
>>>
d
=
"""
hello
welcome
python
"""
>>>
d
'
hello
\n
welcome
\n
python
'
>>>
type
(
d
)
<
class
'
str
'
>
>>>
e
=
a
+
b
>>>
e
'
hello,world.안녕하세요
'
>>>
a
[
0
:
2
]
'
he
'
>>>
'
hel
'
in
a
True
>>>
x
in
a
Traceback
(
most
recent
call
last
):
File
"
<pyshell#60>
"
,
line
1
,
in
<
module
>
x
in
a
NameError
:
name
'
x
'
is
not
defined
>>>
'
x
'
in
a
False
>>>
len
(
a
)
12
>>>
len
(
b
)
5
>>>
#문자열 메소드
>>>
a
=
'
hello
'
>>>
a
.
startwith
(
'
h
'
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#66>
"
,
line
1
,
in
<
module
>
a
.
startwith
(
'
h
'
)
AttributeError
:
'
str
'
object
has
no
attribute
'
startwith
'
>>>
a
.
startswith
(
'
h
'
)
True
>>>
a
.
startswith
(
'
e
'
)
False
>>>
a
.
endswith
(
'
h
'
)
False
>>>
a
.
endswith
(
'
o
'
)
True
>>>
a
.
fine
(
'
hel
'
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#71>
"
,
line
1
,
in
<
module
>
a
.
fine
(
'
hel
'
)
AttributeError
:
'
str
'
object
has
no
attribute
'
fine
'
>>>
a
.
find
(
'
hel
'
)
0
>>>
a
.
find
(
'
ll
'
)
2
>>>
a
.
fine
(
'
x
'
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#74>
"
,
line
1
,
in
<
module
>
a
.
fine
(
'
x
'
)
AttributeError
:
'
str
'
object
has
no
attribute
'
fine
'
>>>
a
.
find
(
'
x
'
)
-
1
>>>
a
.
count
(
'
l
'
)
2
>>>
a
=
'
apple,orange,kiwi
'
>>>
b
=
a
.
split
(
'
,
'
)
>>>
b
[
'
apple
'
,
'
orange
'
,
'
kiwi
'
]
>>>
type
(
b
)
<
class
'
list
'
>
>>>
b
[
0
]
'
apple
'
>>>
b
[
1
]
'
orange
'
>>>
b
[
2
]
'
kiwi
'
>>>
a
=
input
()
b
=
input
()
>>>
resule
=
a
*
b
Traceback
(
most
recent
call
last
):
File
"
<pyshell#85>
"
,
line
1
,
in
<
module
>
resule
=
a
*
b
TypeError
:
can
'
t multiply sequence by non-int of type
'
list
'
>>>
#문자열을 숫자로 바꾸기
>>>
int
(
'
1234567890
'
)
1234567890
>>>
float
(
'
123.4567
'
)
123.4567
>>>
complex
(
'
1+2j
'
)
(
1
+
2j
)
>>>
print
(
"
첫수를 입력하시오 :
"
)
첫수를
입력하시오
:
>>>
===========
RESTART
:
/
Users
/
kimminsub
/
Documents
/
input_multiply
.
py
===========
첫번째
수를
입력하시오
:
5
두번째
수를
입력하시오
:
4
5
*
4
=
20
>>>
type
(
math
.
pi
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#91>
"
,
line
1
,
in
<
module
>
type
(
math
.
pi
)
NameError
:
name
'
math
'
is
not
defined
>>>
import
math
>>>
type
(
math
.
pi
)
<
class
'
float
'
>
>>>
str
(
math
.
pi
)
'
3.141592653589793
'
>>>
type
(
math
.
pi
)
<
class
'
float
'
>
>>>
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