Commit 5c0c6087 by BellCodeEditor

auto save

parent 020b87bb
Showing with 29 additions and 0 deletions
#1.输入一个数,判断是奇数还是偶数
#2.random模块
#3.随机生成一个0-100的数,猜猜大小
#4.for 循环,用for循环分别输出1-10
#5.用for循环计算1+2+3+...+100的和
#a=input('请输入一个数:')
#运算优先级:括幂乘除余加减,大于小于非与或
#先算括号
#算术运算符:**、*、/、//、%、+、-
#比较运算符:>、<、==、>=、<=、!=
#逻辑运算符:not、and、or
# import random
# a=random.randint(0,100)
# while True:
# b=input('请输入你要猜的数:')
# if b>a:
# print('猜大了')
# sum=0
# for i in range(1,101):
# sum=sum+i
# print(sum)
#打印0-100之间所有的偶数
for i in range(0,101):
if i%2!=0:
print(i)
\ 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