Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-2_DIY1
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
07ac174d
authored
Jul 10, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6c27f19c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
23 deletions
diy1.py
diy1.py
View file @
07ac174d
def
s
():
i
=
3
total
=
[]
username
=
"dsbdsb"
while
True
:
userpassward
=
"54188"
money
=
input
(
"请输入(q退出):"
)
while
True
:
if
money
==
"q"
:
if
i
>
0
:
name
=
input
(
"请输入用户名"
)
passward
=
input
(
"请输入密码"
)
i
=
i
-
1
if
username
==
name
and
userpassward
==
passward
:
priut
(
"登录成功"
)
break
break
else
:
if
name
!=
username
:
try
:
print
(
"用户名不存在,请重新输入"
)
money
=
int
(
money
)
continue
except
:
if
passward
!=
userpassward
:
print
(
"请重新输入一个数字"
)
print
(
"密码错误,请重新输入"
)
else
:
else
:
total
.
append
(
money
)
print
(
"你的账户已锁定,请一小时后再来"
)
finally
:
print
(
"大傻逼登录失败"
)
print
(
"-----------------------"
)
print
(
"欢迎来的大傻逼世界"
)
return
total
def
sum
(
money
):
count
=
0
for
i
in
money
:
count
=
count
+
i
return
count
price
=
s
()
pay
=
sum
(
price
)
print
(
"您一共消费了"
+
str
(
pay
)
+
"元!扫码还是现金呢?"
)
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