www.fltk.net > 用python2.7编个程序,拜托~

用python2.7编个程序,拜托~

看代码: # -*- coding: gbk -*-def get_factorial(n): """求一个整数的阶乘""" factorial = 1 if n > 0: for i in range(1, n + 1): factorial *= i return factorialdef to_binary_str(n): """求一个整数的二进制""" s = '' while n > 0: if n...

#用所给字符串测试了一下,可行def string_judg(string): for char in string: if char>='A' and char

def t(): a = raw_input("please input:") return not any(['A'

s = raw_input('[开始加密]please input your str:')s = list(s)n = 0for sw in s: s[n] = chr(ord(sw)+3) n = n + 1sout = ''for sw2 in s: sout = sout + sw2print '[加密结果]:',sout解密的类似,主要用到ord、chr函数。

for i in range(100): if i%3 == 0 or i%10 == 3: print i

用线程吧,给你一个简单的线程实例,真的需要同步的话再做个共享变量,来同步文字和音乐 import threading import time class printscreen(threading.Thread): def __init__(self,name=None): threading.Thread.__init__(self,name=None) def ru...

用python-2.7.3\python是对的,但是你的hello.py放在那里?你需要先用“cd 目录名”转换当前目录到存放hello.py的地方,然后执行python-2.7.3\python hello.py。

print "你的名字" print "你的学号"

for y in range(2001, 2051): if y%400 == 0: print y if y%100 != 0 and y%4 == 0: print y#output:200420082012201620202024202820322036204020442048

网站地图

All rights reserved Powered by www.fltk.net

copyright ©right 2010-2021。
www.fltk.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com