7.23号python新手练习题


#7.23_1
# out = []
# for num in range(1000,3001):
#     s=str(num)
#     if(int(s[0])%2==0 and int(s[1])%2==0 and int(s[2])%2==0 and int(s[3])%2==0):
#         out.append(s)
# print(','.join(out))

#7.23_2
# s=input()
# asum,dsum=0,0
# for x in s:
#     if x.isalpha():
#         asum+=1
#     if x.isdigit():
#         dsum+=1
#     else:
#         pass
# print('LETTER {0}'.format(asum))
# print('DIGIT '+str(dsum))

#7.23_3
# s=input()
# usum=0
# lsum=0
# for x in s:
#     if x.isupper():
#         usum+=1
#     if x.islower():
#         lsum+=1
#     else:
#         pass
# print('UPPER CASE {}\nLOWER CASE {}'.format(usum,lsum))

#7.23_4
# a=input()
# n1=int('%s'%a)
# n2=int('%s%s'%(a,a))
# n3=int('%s%s%s'%(a,a,a))
# n4=int('%s%s%s%s'%(a,a,a,a))
# print(n1+n2+n3+n4)

#7.23_5
# s=input().split(',')
# number=[]
# for n in s:
#     if int(n)%2!=0:
#         number.append(n)
# print(','.join(number))

#7.23_6
# netAmount=0
# while True:
#     s=input()
#     values=s.split(' ')
#     operation=values[0]
#     amount=int(values[1])
#     if operation=='D':
#         netAmount+=amount
#     elif operation=='W':
#         netAmount-=amount
#     else:
#         pass
# print(netAmount)
#7.23_7
# import re
# s=input().split(',')
# value=[]
# for str in s:
#     if len(str)>=12 and len(str)<=6:
#         continue
#     elif not re.search('[a-z]',str):
#         continue
#     elif not re.search('[A-Z]',str):
#         continue
#     elif not re.search('[0-9]',str):
#         continue
#     elif not re.search('[$#@]',str):
#         continue
#     else :
#         pass
#     value.append(str)
# print(','.join(value))

#7.23_8
# from operator import itemgetter,attrgetter
# l=[]
# while True:
#     s=input()
#     if not s:
#         break
#     l.append(tuple(s.split(',')))
# print(sorted(l,key=itemgetter(0,1,2)))


#7,23_9
# def putNumber(n):
#     i=0
#     while i<n:
#         j=i
#         i+=1
#         if j%7==0:
#             yield j
# for i in putNumber(100):
#      print(i)

#7.23_10
# import math
#
# pos=[0,0]
# while True:
#     s=input()
#     if not s:
#         break
#     movement=s.split(' ')
#     direction=movement[0]
#     steps=int(movement[1])
#     if direction=='up':
#         pos[0]+=steps
#     elif direction=='down':
#         pos[0]-=steps
#     elif direction=='left':
#         pos[1]-=steps
#     elif direction=='right':
#         pos[1]+=steps
#     else:
#         pass
# print(int(round(math.sqrt(pos[0]**2+pos[1]**2))))

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值