摘要:
import jieba with open("qi.txt","r",encoding = "utf-8") as f: hua = f.read()word = jieba.cut(hua) count = {}for ci in word: if ci in count: count[ci] 阅读全文
摘要:
{ "cells": [ { "cell_type": "markdown", "id": "3d99180e", "metadata": {}, "source": [ "## 画布知识\n" ] }, { "cell_type": "code", "execution_count": null, 阅读全文
摘要:
# -*- coding: utf-8 -*-"""Created on Tue Apr 13 21:31:58 2021 @author: Administrator"""#coding=utf-8import turtlespiral=turtle.Turtle()ninja=turtle.Tu 阅读全文
摘要:
#coding=utf-8import turtlepainter= turtle.Turtle()painter.pencolor("blue") for i in range(30): painter.forward(30) #数字是代表半径 painter.left(100) painter. 阅读全文
摘要:
#北京奥运会吉祥录制import turtleturtle.title('冰墩墩')turtle.speed(40) # 可以自己调节速度# 左手turtle.penup()turtle.goto(177, 112)turtle.pencolor("lightgray")turtle.pensize 阅读全文
摘要:
# -*- coding: utf-8 -*-"""Created on Tue Apr 13 21:31:12 2021 @author: Administrator"""#coding=utf-8import turtle#画五角星(动态)spiral=turtle.Turtle() for i 阅读全文
摘要:
from turtle import *import time setup(800,600,0,0)speed(0)penup()seth(90)fd(340)seth(0)pendown() speed(5)begin_fill()fillcolor('red')circle(50,30) for 阅读全文
摘要:
"""简单的计算器 这是一个简单的计算器,可以进行加、减、乘、除四种运算。 代码如下: """# 简单的计算器 # 加法def add(a, b): return a + b # 减法def sub(a, b): return a - b # 乘法def mul(a, b): return a * 阅读全文
摘要:
# 学生成绩管理系统 # 定义学生信息元组student = ('name', 'age', 'gender', 'score') # 定义学生信息列表students = [] # 添加学生信息def add_student(): name = input("请输入学生姓名:") age = in 阅读全文
摘要:
#一个有趣的元组应用案例是使用元组来模拟掷骰子游戏。在这个游戏中,玩家掷两个骰子并将它们的点数相加。#如果点数为985,则玩家A胜利;如果点数为211,则玩家B胜利;如果点数为其他数字,则玩家继续掷骰子。 #下面是一个使用元组来模拟掷骰子游戏的示例代码: import random def roll 阅读全文