turtle math
x1y1 = x2y2 = -x3y3 = --x4y4 = -turtle.penup() turtle.goto(x1y1) turtle.pendown() turtle.pensize() turtle.pencolor() turtle.goto(x2y2) turtle.color() turtle.goto(x3y3) turtle.color() turtle.goto(x4y4) turtle.color() dinstance = math.sqrt((x1-x4)**+(y1-y4)**) turtle.write(dinstance) turtle.done()
#include <iostream>
using namespace std;
struct point
{
int x;
int y;
};
void show(point& pt)
cout << "point:(" << pt.x << "," << pt.y << ")";
cout << endl;
}
int main()
point a=point{3,5};
point b={10,20};
point c=a;
show(a);
return 0;
为什么输出的是这种
import time b = (time.time()) (b) totalMinutes = b//(totalMinutes) totalHours = totalMinutes//(totalHours) totalDays = totalHours//(totalDays) totalDYears = totalDays//(totalDYears)
a=9
a *= a*10
print(a) #810
num=input('输入一个数字:')print('你的数字是:‘+str(num) if int(num)>10 else '数字太小')
老师,为什么这样会报错
a = 99**1000 pirnt(a)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<canvas id="myCanvas" width="1000px" height="1000px"></canvas>
<script>
var c = document.getElementById("myCanvas")
var ctx = c.getContext("2d");
//绘制圆
ctx.arc(100,100,50,0,2*Math.pI);
ctx.stroke()
</script>
</body>
</html>
老师,这个代码没有显示出圆
a = 7/2
a,b,c, = 10,20,30 print(a,b,c,) a,b,c, = c,b,a #变量值互换 print(c,b,a)
a = 321
print(a)
a = 654
a = 123 del(a) print(a)
这是什么原因,为什么第一个名字可以使用,第二个不行
#方法3:remove(),删除内容的元素,若有多个,则删除第一个,如果没有则报错 print("方法3") a=[10,20,30,20,40,50] print("a的值",a) b=a print("b的值",b) b.remove(20) print("a的值",a) print("b的值",b)
老师这行代码运行结果不对劲呀,我明明是对b进行remove(20)元素,为什么a的也跟着删20元素了
a = (13218941965\ 1984615\ 69448948) print(a)
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637