day2笔记

# your_name =input("请输入你的名字:")
# print('你的名字是:',your_name)


# score=input('请输入你的分数:')
# print('score的类型:',type(score))
# score=int(score)
# if score >= 90:
# print('优秀')
# elif score<90 and score >=75:
# print('良好')
# elif score>=60 and score<75:
# print('及格')
# else:
# print('不及格')


# #for while

# while
# count = 1#计数器
# rate = 140 #心率
# while count <=10:
# if rate >160:
# break
# print('跑圈:', count)
# count=count+1
# rate+=5
#
# count=0
# rate=140
# while count<10:
# count += 1
# if rate>160:
# print('休息一圈!')
# rate-=20
# continue
# else:
# print('跑圈:',count,'心率:',rate)
# rate+=5


# #for循环
# rate = 140 # 心率
# for count in range(8):
# print('跑圈:',count)
# if rate>160:
# print('你的心跳太快,需要休息')
# break
# rate+=5



#猜数字游戏:产生一个随机数,最多输入5次,如果猜得不对,提示大了或者小了,猜对了游戏结束,如果次数用尽还没猜对,提示次数用尽。
#coding:utf-8
# import random
#
# x = random.randint(1,10)
# for count in range(5):
# a=input('请输入一个数:')
# a=int(a)
# if a==x:
# print('猜对了!')
# break
# elif a < x:
# print('小了!')
# elif a > x:
# print('大了!')
# else:
# print('次数已用尽!')
#

#格式化
#
# name = '李磊'
# age = 18
# score=98
# addr='广州'
# print('%s,你好,你的成绩是:%s,地址是:%s'%(name,score,addr))
# welcome='%s,你好,你的成绩是:%s,地址是:%s'%(name,score,addr)
# print(welcome)
#
# print('{name},你好,你的成绩是:{score},地址是:{addr}'.format(name=name,score=score,addr=addr))


# 数组 list
#
# student_new=['李磊','张明','张宏']
# print(student_new[1])
# # 增
# student_new.append('李韩寒')
# student_new.insert(0,'刘瀚阳')
# print(student_new)
# print(student_new[-1])
# # 改
# student_new[3]='张红'
# print(student_new)
# # 删除
# student_new.pop(0)
# student_new.remove('李韩寒')
# del student_new[2]
# print(student_new)
#
# student_new.count()
# student_new.index()
# student_new.extend()
# student_new.reverse()
# student_new.sort()


# 数组练习
# student_info=[]
# while 1>0:
# name=input('请输入姓名:')
# if name =='over':
# print(student_info)
# break
# else:
# count=student_info.count(name)
# if count!=0:
# print('已存在')
# continue
# else:
# student_info.append(name)


# student_info=[]
# while 1>0:
# name=input('请输入姓名:')
# if name =='over':
# print(student_info)
# break
# # elif student_info.count(name) > 0:
# elif name in student_info:
# print('已存在')
# continue
# else:
# student_info.append(name)



posted @ 2020-08-14 01:00  xianfeng1224  阅读(65)  评论(0)    收藏  举报