Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_4
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
a6c1ec2c
authored
May 20, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
45396374
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
23 deletions
3.py
4.py
67.py
diy3.py
dvojfdi.py
3.py
0 → 100644
View file @
a6c1ec2c
a
=
int
(
input
(
"输入一个正整数"
))
s
=
0
if
a
%
2
==
0
:
for
i
in
range
(
2
,
a
+
1
,
2
):
s
=
s
+
1
/
i
if
a
%
2
==
1
:
for
i
in
range
(
1
,
a
+
1
,
2
):
s
=
s
+
1
/
i
print
(
"
%.2
f"
%
s
)
4.py
0 → 100644
View file @
a6c1ec2c
for
ab
in
range
(
10
,
100
):
x
=
100
+
ab
y
=
ab
*
10
+
1
if
x
-
y
==
468
or
y
-
x
==
468
:
print
(
ab
)
\ No newline at end of file
67.py
0 → 100644
View file @
a6c1ec2c
for
gj
in
range
(
1
,
99
):
for
mj
in
range
(
1
,
99
):
xj
=
100
-
gj
-
mj
if
5
*
gj
+
3
*
mj
+
xj
/
3
==
100
:
print
(
gj
,
mj
,
xj
)
\ No newline at end of file
diy3.py
View file @
a6c1ec2c
student1
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
student2
=
{
'语文'
:
97
,
'数学'
:
98
,
'英语'
:
90
}
student3
=
{
'语文'
:
95
,
'数学'
:
100
,
'英语'
:
93
}
score
=
{
'悟空'
:
student1
,
'诺依'
:
student2
,
'小贝'
:
student3
}
# 查询并打印出输入的名字对应的所有科目的成绩
while
True
:
name
=
input
(
"名字:"
)
if
name
==
"q"
:
break
elif
name
in
score
:
a
=
score
[
name
]
print
(
'='
*
30
)
for
k
,
v
in
a
.
items
():
print
(
k
,
v
)
print
(
"="
*
30
)
class
Price
():
def
pay
(
self
):
a
=
int
(
input
(
"星期几"
))
b
=
int
(
input
(
"成人人数"
))
c
=
int
(
input
(
"小孩人数"
))
if
a
<
6
:
print
(
"需要支付"
+
str
(
b
*
100
+
c
*
50
)
+
"元"
)
else
:
print
(
'输入错误'
)
\ No newline at end of file
print
(
"需要支付"
+
str
(
b
*
120
+
c
*
60
)
+
"元"
)
b
=
Price
()
b
.
pay
()
dvojfdi.py
View file @
a6c1ec2c
for
ji
in
range
(
1
,
35
):
tu
=
35
-
ji
if
tu
+
ji
==
35
and
4
*
tu
+
2
*
ji
==
94
:
print
(
"兔有{}只,鸡有{}只"
.
format
(
tu
,
ji
))
\ No newline at end of file
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