兩個不同顏色猜數字,兩個不同顏色猜三個數字

2021-03-04 04:47:23 字數 8870 閱讀 9133

1樓:僑中黃建成

兩個不同顏色猜三個數字——答案:256。

五顏六色

wǔ yán liù sè

【解釋】形容色彩複雜或花樣繁多。引伸為各色各樣。

【出處】清·李汝珍《鏡花緣》第十四回:「惟各人所登之雲,五顏六色,其形不一。」

【結構】聯合式。

【用法】多用來形容鮮花、商品、服裝、景物等的花色繁多。一般作謂語、定語。

【正音】色;不能讀作「shǎi」。

【辨形】顏;不能寫作「彥」。

【近義詞】五彩繽紛、萬紫千紅

【反義詞】色彩單一

【辨析】~和「五彩繽紛」都形容顏色多。但~偏重於色彩多種多樣;僅用於具體事物;「五彩繽紛」偏重於色彩繁雜;非常悅目;它能用於抽象的理想、前途等。

【例句】

(1)她見我來了;立即拿出一把~的糖果來。

(2)佛子嶺開著~的花;真是一個大花園。

用python,turtle繪製數字,如繪製260這三個數字,同時要求每個數字填不同的顏色

2樓:12345額時代

1、雙擊開啟pycharm開發工具,在已新建的專案中新建python檔案,輸入檔名稱。

2、開啟已新建的python檔案,匯入turtle管理包。

3、呼叫screen()方法生成螢幕,並使用bgcolor()方法設定背景圖。

4、呼叫turtle,並使用shape()方法和color()方法設定圖形和字型顏色。

5、接著呼叫speed()方法,設定繪製的速度。

6、最後,呼叫滑鼠點選關閉的方法exitonclick,用於控制關閉視窗的方法。

3樓:匿名使用者

import turtle as t

t.hideturtle()

t.setup()

t.penup()

t.pencolor('red')

t.write('2',font=("times", 33, "normal"))

t.fd(40)

t.pencolor('blue')

t.write('6',font=("times", 33, "normal"))

t.fd(40)

t.pencolor('yellow')

t.write('0',font=("times", 33, "normal"))

t.done()

最簡單的一種,直接執行**,也可以定義一段函式列印想要的數字。因為懶得寫

4樓:天天不看

turtle庫是python語言中一個很流行的繪製影象的函式庫,想象一個小烏龜,在一個橫軸為x、縱軸為y的座標系原點,(0,0)位置開始,它根據一組函式指令的控制,在這個平面座標系中移動,從而在它爬行的路徑上繪製了圖形。

turtle繪圖的基礎知識:

1. 畫布(canvas)

畫布就是turtle為我們用於繪圖區域,我們可以設定它的大小和初始位置。

設定畫布大小

turtle.screensize(canvwidth=none, canvheight=none, bg=none),引數分別為畫布的寬(單位畫素), 高, 背景顏色。

如:turtle.screensize(800,600, "green")

turtle.screensize() #返回預設大小(400, 300)

turtle.setup(width=0.5, height=0.

75, startx=none, starty=none),引數:width, height: 輸入寬和高為整數時, 表示畫素; 為小數時, 表示佔據電腦螢幕的比例,(startx, starty):

這一座標表示矩形視窗左上角頂點的位置, 如果為空,則視窗位於螢幕中心。

如:turtle.setup(width=0.6,height=0.6)

turtle.setup(width=800,height=800, startx=100, starty=100)

2. 畫筆

2.1 畫筆的狀態

在畫布上,預設有一個座標原點為畫布中心的座標軸,座標原點上有一隻面朝x軸正方向小烏龜。這裡我們描述小烏龜時使用了兩個詞語:座標原點(位置),面朝x軸正方向(方向), turtle繪圖中,就是使用位置方向描述小烏龜(畫筆)的狀態。

2.2 畫筆的屬性

畫筆(畫筆的屬性,顏色、畫線的寬度等)

1) turtle.pensize():設定畫筆的寬度;

2) turtle.pencolor():沒有引數傳入,返回當前畫筆顏色,傳入引數設定畫筆顏色,可以是字串如"green", "red",也可以是rgb 3元組。

3) turtle.speed(speed):設定畫筆移動速度,畫筆繪製的速度範圍[0,10]整數,數字越大越快。

2.3 繪圖命令

操縱海龜繪圖有著許多的命令,這些命令可以劃分為3種:一種為運動命令,一種為畫筆控制命令,還有一種是全域性控制命令。

(1)    畫筆運動命令

命令說明

turtle.forward(distance)

向當前畫筆方向移動distance畫素長度

turtle.backward(distance)

向當前畫筆相反方向移動distance畫素長度

turtle.right(degree)

順時針移動degree°

turtle.left(degree)

逆時針移動degree°

turtle.pendown()

移動時繪製圖形,預設時也為繪製

turtle.goto(x,y)

將畫筆移動到座標為x,y的位置

turtle.penup()

提起筆移動,不繪製圖形,用於另起一個地方繪製

turtle.circle()

畫圓,半徑為正(負),表示圓心在畫筆的左邊(右邊)畫圓

setx( )

將當前x軸移動到指定位置

sety( )

將當前y軸移動到指定位置

setheading(angle)

設定當前朝向為angle角度

home()

設定當前畫筆位置為原點,朝向東。

dot(r)

繪製一個指定直徑和顏色的圓點

(2)     畫筆控制命令

命令說明

turtle.fillcolor(colorstring)

繪製圖形的填充顏色

turtle.color(color1, color2)

同時設定pencolor=color1, fillcolor=color2

turtle.filling()

返回當前是否在填充狀態

turtle.begin_fill()

準備開始填充圖形

turtle.end_fill()

填充完成

turtle.hideturtle()

隱藏畫筆的turtle形狀

turtle.showturtle()

顯示畫筆的turtle形狀

(3)    全域性控制命令

命令說明

turtle.clear()

清空turtle視窗,但是turtle的位置和狀態不會改變

turtle.reset()

清空視窗,重置turtle狀態為起始狀態

turtle.undo()

撤銷上一個turtle動作

turtle.isvisible()

返回當前turtle是否可見

stamp()

複製當前圖形

turtle.write(s [,font=("font-name",font_size,"font_type")])

寫文字,s為文字內容,font是字型的引數,分別為字型名稱,大小和型別;font為可選項,font引數也是可選項

(4)    其他命令

命令說明

turtle.mainloop()或turtle.done()

啟動事件迴圈 -呼叫tkinter的mainloop函式。

必須是烏龜圖形程式中的最後一個語句。

turtle.mode(mode=none)

設定烏龜模式(「standard」,「logo」或「world」)並執行重置。如果沒有給出模式,則返回當前模式。

模式初始龜標題正角度standard向右(東)逆時針logo向上(北)順時針

turtle.delay(delay=none)

設定或返回以毫秒為單位的繪圖延遲。

turtle.begin_poly()

開始記錄多邊形的頂點。當前的烏龜位置是多邊形的第一個頂點。

turtle.end_poly()

停止記錄多邊形的頂點。當前的烏龜位置是多邊形的最後一個頂點。將與第一個頂點相連。

turtle.get_poly()

返回最後記錄的多邊形。

3. 命令詳解

3.1 turtle.circle(radius, extent=none, steps=none)

描述:以給定半徑畫圓

引數:radius(半徑):半徑為正(負),表示圓心在畫筆的左邊(右邊)畫圓;

extent(弧度) (optional);

steps (optional) (做半徑為radius的圓的內切正多邊形,多邊形邊數為steps)。

舉例:circle(50) # 整圓;

circle(50,steps=3) # 三角形;

circle(120, 180) # 半圓

例項:1、太陽花

[python] view plain copy

# coding=utf-8

import turtle

import time

# 同時設定pencolor=color1, fillcolor=color2

turtle.color("red", "yellow")

turtle.begin_fill()

for _ in range(50):

turtle.forward(200)

turtle.left(170)

turtle.end_fill()

turtle.mainloop()

2、五角星

[python] view plain copy

# coding=utf-8

import turtle

import time

turtle.pensize(5)

turtle.pencolor("yellow")

turtle.fillcolor("red")

turtle.begin_fill()

for _ in range(5):

turtle.forward(200)

turtle.right(144)

turtle.end_fill()

time.sleep(2)

turtle.penup()

turtle.goto(-150,-120)

turtle.color("violet")

turtle.write("done", font=('arial', 40, 'normal'))

turtle.mainloop()

3、時鐘程式

[python] view plain copy

# coding=utf-8

import turtle

from datetime import *

# 抬起畫筆,向前運動一段距離放下

def skip(step):

turtle.penup()

turtle.forward(step)

turtle.pendown()

def mkhand(name, length):

# 註冊turtle形狀,建立錶針turtle

turtle.reset()

skip(-length * 0.1)

# 開始記錄多邊形的頂點。當前的烏龜位置是多邊形的第一個頂點。

turtle.begin_poly()

turtle.forward(length * 1.1)

# 停止記錄多邊形的頂點。當前的烏龜位置是多邊形的最後一個頂點。將與第一個頂點相連。

turtle.end_poly()

# 返回最後記錄的多邊形。

handform = turtle.get_poly()

turtle.register_shape(name, handform)

def init():

global sechand, minhand, hurhand, printer

# 重置turtle指向北

turtle.mode("logo")

# 建立三個錶針turtle並初始化

mkhand("sechand", 135)

mkhand("minhand", 125)

mkhand("hurhand", 90)

sechand = turtle.turtle()

sechand.shape("sechand")

minhand = turtle.turtle()

minhand.shape("minhand")

hurhand = turtle.turtle()

hurhand.shape("hurhand")

for hand in sechand, minhand, hurhand:

hand.shapesize(1, 1, 3)

hand.speed(0)

# 建立輸出文字turtle

printer = turtle.turtle()

# 隱藏畫筆的turtle形狀

printer.hideturtle()

printer.penup()

def setupclock(radius):

# 建立表的外框

turtle.reset()

turtle.pensize(7)

for i in range(60):

skip(radius)

if i % 5 == 0:

turtle.forward(20)

skip(-radius - 20)

skip(radius + 20)

if i == 0:

turtle.write(int(12), align="center", font=("courier", 14, "bold"))

elif i == 30:

skip(25)

turtle.write(int(i/5), align="center", font=("courier", 14, "bold"))

skip(-25)

elif (i == 25 or i == 35):

skip(20)

turtle.write(int(i/5), align="center", font=("courier", 14, "bold"))

skip(-20)

else:

turtle.write(int(i/5), align="center", font=("courier", 14, "bold"))

skip(-radius - 20)

else:

turtle.dot(5)

skip(-radius)

turtle.right(6)

def week(t):

week = ["星期一", "星期二", "星期三",

"星期四", "星期五", "星期六", "星期日"]

return week[t.weekday()]

def date(t):

y = t.year

m = t.month

d = t.day

return "%s %d%d" % (y, m, d)

def tick():

# 繪製錶針的動態顯示

t = datetime.today()

second = t.second + t.microsecond * 0.000001

minute = t.minute + second / 60.0

hour = t.hour + minute / 60.0

sechand.setheading(6 * second)

minhand.setheading(6 * minute)

hurhand.setheading(30 * hour)

turtle.tracer(false)

printer.forward(65)

printer.write(week(t), align="center",

font=("courier", 14, "bold"))

printer.back(130)

printer.write(date(t), align="center",

font=("courier", 14, "bold"))

printer.home()

turtle.tracer(true)

# 100ms後繼續呼叫tick

turtle.ontimer(tick, 100)

def main():

# 開啟/關閉龜動畫,併為更新圖紙設定延遲。

turtle.tracer(false)

init()

setupclock(160)

turtle.tracer(true)

tick()

turtle.mainloop()

if __name__ == "__main__":

main()

電腦兩個使用者可以裝兩個不同的系統嗎

你這個說法是錯誤的,應該是在一個系統上建立多個使用者,使用者怎麼可能建立多個系統呢,使用者是建立系統基礎上的,裝兩個系統完全可以,一個win7一個xp,到時設上各自密碼就ok了,不過他就是兩個獨立系統,不屬於那個使用者,xp要是裝的話,建議到官方看看有沒有你的硬體驅動,一些新配置的電腦官方已經不提供...

從19這數字中,每次取兩個不同的數字組成兩位數,而

一共有32個 29 38 39 47 48 49 56 57 58 59 65 67 68 69 74 75 76 78 79 83 84 85 86 87 89 92 93 94 95 96 97 98.從1 9這九個數字中,每次取兩個不同的數字組成一個兩位數,而十位與個位上數字的和都必須比10大...

這兩個是動漫嗎,這兩個顏色像嗎

這兩部是漫畫 要是覺得滿意我的答案請記得采納,祝你有美好的一天。你好,是的,當然你也可以直接使用 進行查詢的。第二個可能不是吧應該是網圖,第一張是動漫,麻煩理一下,給個贊。是的,這兩個肯定是動漫。第一張 不是有寫的嗎?第二張沒看過 我能百分之一百確定,這是動漫 是動漫,我覺得是什麼什麼的魔術師 這兩...