"""
# -*- coding: cp936 -*-
#求500内的所有素数
t=[]
def num():
for i in range(1,501):
if i%2!=0:
print‘是素数‘,i
print num()
#!/usr/bin/python
#-*- coding:utf-8 -*-
#there is no ++ operator in Python
import string
def main():
s=raw_input(‘请输入:‘)
letter=0
space=0
digit=0
other=0
for i in s:
if i.isalpha():
letter+=1
elif i.isspace():
space+=1
elif i.isdigit():
digit+=1
else:
other+=1
print‘你输入的字母%d:,空格%d:,数字%d:,其他%d:‘%(letter,space,digit,other)
if __name__==‘__main__‘:
main()
"""
时间: 2024-11-12 18:28:15