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
5ffa677d
authored
Jun 21, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
d7786566
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
DIY4_6.py
test.py
DIY4_6.py
View file @
5ffa677d
...
...
@@ -17,4 +17,5 @@ while True:
print
(
"温馨提示:您还有"
+
str
(
i
)
+
"次登录机会"
)
else
:
print
(
"您的账户已被锁定!"
)
exit
()
print
(
"欢迎来到贝尔编程!"
)
\ No newline at end of file
test.py
0 → 100644
View file @
5ffa677d
# N=input('请输入一个数字:')
# if N=='10':
# print('yes')
# else:
# print('no')
# y=int(input('请输入语文成绩:'))
# m=int(input('请输入数学成绩:'))
# e=int(input('请输入英语成绩:'))
# a=y+m+e
# if a>285:
# print('去游乐园')
# elif 241<a<=285:
# print('做一天作业')
# else:
# print('周末两天都做作业')
# a=int(input('请输入一个整数:'))
# b=int(input('请输入一个整数:'))
# if a/b==3:
# print('恭喜')
# else:
# print(a/b)
# a=int(input("请输入一个整数:"))
# if a==1:
# print('Monday')
# elif a==2:
# print('Tuesday')
# elif a==3:
# print('Wednesday')
# elif a==4:
# print('Thursday')
# elif a==5:
# print('Friday')
# elif a==6:
# print('Saturday')
# elif a==7:
# print('Sunday')
# else:
# print('false')
# a=int(input("请输入数字a:"))
# b=int(input("请输入数字b:"))
# c=int(input("请输入数字c:"))
# if a+b>c and a+c>b and b+c>a:
# print('能组成三角形')
# else:
# print('不能组成三角形')
f
=
input
(
'请输入运算符号:'
)
if
f
==
list
(
'+'
,
'-'
,
'*'
,
'/'
):
a
=
int
(
input
(
'请输入数字1:'
))
b
=
int
(
input
(
'请输入数字2:'
))
if
f
==
'+'
:
print
(
a
+
b
)
elif
f
==
'-'
:
print
(
a
-
b
)
elif
f
==
'*'
:
print
(
a
*
b
)
elif
f
==
'/'
:
if
a
/
b
==
0
:
print
(
'Divided by zero'
)
else
:
print
(
a
/
b
)
else
:
print
(
'Invalid operator'
)
# a=int(input('请输入数字1:'))
# b=int(input('请输入数字2:'))
# print(str(a)+"+"+str(b)+"="+str(a+b))
# print(str(a)+"-"+str(b)+"="+str(a-b))
# print(str(a)+"*"+str(b)+"="+str(a*b))
# print(str(a)+"/"+str(b)+"="+str(a/b))
# print(str(a)+"**"+str(b)+"="+str(a**b))
\ 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