Commit 48cf3791 by BellCodeEditor

auto save

parent 8d9089ae
Showing with 54 additions and 2 deletions
import random
a = "今晚动手"
b = "爱国时间啊肯定会撒扩大撒娇客户四大皆空黑客技术是覅就"
index = random.randint(0,len(a))
c = list(a)
c.insert(index,"#$%^&")
a = "".join(c)
for i in a:
str1 = i
str2 = random.choice(b)
str3 = random.choice(b)
text = str1 + str2 + str3
print(text,end="")
\ No newline at end of file
a = 0#变量
b()#函数
"abc"#字符串
def #关键字
==#等于
=#赋值
#7月6日
getx()#x的坐标
gety()#y的坐标
if iskeydown("a"):#判断是否按下a键
if istouching("bug"):#判断是否碰到bug
if distanceto("bug") == 0:#判断是否和bug的距离等于0
if...else...#如果...那么...否则...
#7月7日
if ismousedown():#是否按下鼠标
while...#满足...条件循环
faceto()#面向
moveto()#移到
#7月8日
#三大运算符
#数学运算符
+ - * / %
#比较运算符
> < == >= <=
#逻辑运算符
and or not
#项目名/程序名
\ No newline at end of file
try:
age = int(input('你今年几岁了'))
except:
print('要输入整数啊')
else:
if age < 18:
print('不可以喝酒嗷')
print('程序结束~')
\ No newline at end of file
...@@ -5,9 +5,9 @@ scores = {'语文':89, '数学':95, '英语':80} ...@@ -5,9 +5,9 @@ scores = {'语文':89, '数学':95, '英语':80}
def get_average(scores): def get_average(scores):
score = 0 score = 0
for i in scores.key(): for i in scores.keys():
score += scores[i] score += scores[i]
print('现在的总分是'+str(score)) print('现在的总分是'+str(score))
ave_score = score/len(scores) ave_score = int(score/len(scores))
print('平均分是'+str(ave_score)) print('平均分是'+str(ave_score))
get_average(scores) get_average(scores)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment