python
GrayFox_83
这个作者很懒,什么都没留下…
展开
-
minecraft同步时钟-python
import mcpi.minecraft as minecraftimport mcpi.block as blockimport mcpi.minecraftstuff as minecraftstuffimport timeimport datetimeimport mathdef findPointOnCircle(cx,cy,radius,angle): x = cx原创 2018-01-24 23:39:43 · 1102 阅读 · 2 评论 -
python杨辉三角
输入n,输出n行杨辉三角row_one=[1]row_two=[1]n=int(input())for x in row_one: print(x)for i in range(n-1): c=0 for j in range(len(row_one)-1): if(len(row_one)>1): row_two.app原创 2018-01-09 18:08:07 · 389 阅读 · 0 评论 -
用素数因子分解一个正整数
def prime(x): if(x==1): return 1 elif(x==2): return 1 elif(x%1==0): for i in range(2,x): if(x%i==0): return 0 break原创 2018-01-09 18:10:44 · 843 阅读 · 0 评论 -
购物车python
market_basket=[]print("请每行输入一对商品名和价格用“空格”隔开,输入end结束录入\n")for i in range(100): item={"name":"","price":""} list_a=[] list_a=input().split(" ") if(list_a[0]=='end'): break it原创 2018-01-09 18:12:12 · 392 阅读 · 0 评论 -
分类统计一句英文里的单词数python
string=input("input string:")string_list=string.split(" ")word_dict={}for word in string_list: if word in word_dict: word_dict[word]+=1 else: word_dict[word]=1print(word_dic原创 2018-01-09 18:16:47 · 4683 阅读 · 4 评论 -
python-指定范围内的互满数
def fullnum(x,y): int(x) int(y) List_1=[] List_2=[] for a in range(x,y+1): m=0 n=0 for i in range(1,a): if(a%i==0): m+=i原创 2018-01-10 14:52:05 · 2156 阅读 · 0 评论 -
minecraft-障碍跳跃收集方块-python
# -*- coding: cp936 -*-import mcpi.minecraft as minecraftimport mcpi.block as blockimport mcpi.minecraftstuff as minecraftstuffimport timeimport randomimport threadARENAX = 10ARENAZ = 20ARENA原创 2018-01-28 22:30:21 · 1236 阅读 · 0 评论