MOOC 《Python语言程序设计》 作业:
#!usr/bin/env python # -*- coding:utf-8 -*- # Author: Wayne Zhong # str1 = input('请输入一个人的名字:') # str2 = input('请输入一个国家名字:') # print('世界这么大,{}想去{}看看。'.format(str1,str2)) # n = input('请输入整数N:') # sum = 0 # for i in range(int(n)): # sum += i + 1 # print('1到N求和结果:', sum) # for i in range(1,10): # for j in range(1,i+1): # print('{}*{}={:2} '.format(j,i,i*j), end='') # print('') # sum, tmp = 0, 1 # for i in range(1,11): # tmp *= i # sum += tmp # print('运算结果是:{}'.format(sum)) # n = 1 # for i in range(5, 0, -1): # n = (n+1)<<1 # print(n) # print(n) # diet = ['西红柿', '花椰菜', '黄瓜', '牛排', '虾仁'] # for x in range(0, 5): # for y in range(0, 5): # if not(x == y): # print("{}{}".format(diet[x], diet[y])) # from turtle import * # fillcolor("black") # begin_fill() # while True: # forward(200) # right(144) # if abs(pos()) < 1: # break # end_fill() # done() # from turtle import * # color('blue', 'blue') # begin_fill() # while True: # forward(200) # left(170) # if abs(pos()) < 1: # break # end_fill() # done() # import turtle # import time # # turtle.speed("fastest") # turtle.pensize(2) # for x in range(100): # turtle.forward(2 * x) # turtle.left(90) # time.sleep(3) # import turtle # import time # # turtle.pensize(2) # turtle.bgcolor("black") # colors = ["red", "yellow",'purple','blue'] # turtle.tracer(False) # for x in range(400): # turtle.forward(2*x) # turtle.color(colors[x % 4]) # turtle.left(91) # turtle.tracer(True)