Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_6
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8946f41f
authored
Jul 12, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
6dc5df04
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
diy1.py
diy2.py
diy3.py
test.db
diy1.py
0 → 100644
View file @
8946f41f
a
,
b
,
c
,
d
=
input
(
"输入圆的半径:"
)
.
split
(
","
)
print
(
type
(
a
))
diy2.py
0 → 100644
View file @
8946f41f
import
turtle
turtle
.
speed
(
100
)
turtle
.
penup
()
turtle
.
goto
(
0
,
-
200
)
turtle
.
pendown
()
turtle
.
circle
(
200
)
turtle
.
penup
()
turtle
.
goto
(
-
50
,
-
50
)
turtle
.
pendown
()
for
i
in
range
(
3
):
turtle
.
forward
(
100
)
turtle
.
left
(
120
)
turtle
.
penup
()
turtle
.
goto
(
-
90
,
70
)
turtle
.
pendown
()
turtle
.
fillcolor
(
"blue"
)
turtle
.
begin_fill
()
turtle
.
circle
(
20
)
turtle
.
end_fill
()
turtle
.
penup
()
turtle
.
goto
(
90
,
70
)
turtle
.
pendown
()
turtle
.
fillcolor
(
"blue"
)
turtle
.
begin_fill
()
turtle
.
circle
(
20
)
turtle
.
end_fill
()
turtle
.
penup
()
turtle
.
goto
(
-
150
,
-
50
)
turtle
.
pendown
()
turtle
.
right
(
15
)
turtle
.
goto
(
0
,
-
150
)
turtle
.
goto
(
150
,
-
50
)
turtle
.
done
()
\ No newline at end of file
diy3.py
0 → 100644
View file @
8946f41f
import
sqlite3
conn
=
sqlite3
.
connect
(
'test.db'
)
print
(
"Opened database successfully"
)
c
=
conn
.
cursor
()
c
.
execute
(
"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
\
VALUES (1, 'Paul', 32, 'California', 20000.00 )"
)
c
.
execute
(
"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
\
VALUES (2, 'Allen', 25, 'Texas', 15000.00 )"
)
c
.
execute
(
"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
\
VALUES (3, 'Teddy', 23, 'Norway', 20000.00 )"
)
c
.
execute
(
"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
\
VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 )"
)
cursor
=
c
.
execute
(
"SELECT id, name, address, salary from COMPANY"
)
for
row
in
cursor
:
print
(
"ID = "
,
row
[
0
])
print
(
"NAME = "
,
row
[
1
])
print
(
"ADDRESS = "
,
row
[
2
])
print
(
"SALARY = "
,
row
[
3
],
"
\n
"
)
print
(
"Operation done successfully"
)
conn
.
close
()
\ No newline at end of file
test.db
0 → 100644
View file @
8946f41f
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment