我的第一个Python程序

2023-05-16

突然想学Python了,今天开始学习,编出了我的第一个Python程序

#calculate the area and circumference of a circle from its radius
import math
radiusString =input("Enter the radius of your circle:")
radiusInteger =int(radiusString)
circumference=2*math.pi*radiusInteger
area=math.pi*(radiusInteger**2)
print ("The cirumference is:%.2f,and the area is:%.2f"%(circumference,area))


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

我的第一个Python程序 的相关文章

随机推荐

  • 较好的程序设计竞赛有哪些

    一 含金量最高 最出名的ACM ICPC xff1a https icpc baylor edu 二 百度的百度之星 xff1a http star baidu com 官微 xff1a http weibo com baiduastar
  • c++ string比较大小

    很简单 xff0c 像整型一样直接比较 例如 xff1a include lt iostream gt include lt string gt using namespace std int main string a 61 34 abc
  • UVA230解题报告

    这个题耗了我六天时间 xff0c 很打击我对算法的学习 xff0c 不过 xff0c 我终于解决了他 分析如下 仔细观察我们可以发现后面的操作与输出都是围绕标题 xff08 title xff09 展开的 xff0c 作者 xff08 au
  • hibernate数据修改后不能及时更新

    错误描述 使用hibernate更新或者插入数据后明明数据库中保存进去了但是查出来的结果还是以前的 解决方案 在查询之前调用session clear 清理缓存
  • 经典不定积分题解

  • Android老师作业八

    一 xff1a 第一条广播 第二条广播 xff08 因为第一条广播的优先级比第二条广播的优先级高 xff09 二 第一条广播 第二条广播 xff08 因为第一条广播注册的顺序比第二条广播注册的顺序靠前 xff09 三 第一条广播 广播被我拦
  • 用散列表实现输入拼音输出大写英文字母的功能

    我本来是想实现输入拼音输出汉字的功能 xff0c 可是 xff0c 好像是因为C语言只能识别256个ASCII码 xff0c 所以出现了乱码现象 xff0c 所以我不得已把汉字改成了大写英文字母 实现的关键是哈希函数 xff0c 这里因为我
  • hibernate增删改查

    package cn gov test import java util Set import cn gov entity Address import cn gov entity Person import cn gov factory
  • 如何报名计算机等级考试

    只限山东考生 进入http www sdzk cn zsks index shtm如图 xff0c 点击全国计算机等级考试 进入下图网页 xff0c 选择你要考试的城市 注册一个账号或登录 选择当前场次 选择同意 填写个人信息 xff0c
  • bootstrapvalidator实现校验、校验清除重置

    问题 xff1a 经常开发中用到modal对话框弹出验证以后第二次弹框时上次的验证效果依然有效 xff0c 那就要想办法第二次弹框之前去掉上次的验证 xff1b 解决办法 xff1a 1 引入bootstrap的validator的校验js
  • ACM题目分类

    基本算法 模拟题 xff1a UVA118 递推 xff1a 勘测 位运算 xff1a Sum AND Subarrays 快速幂 xff1a dreamstart的催促 动态规划 xff1a LCS xff1a UVA10192 动态规划
  • 简单选择排序

    与冒泡排序相反 xff0c 每次把最小的 xff08 升序 xff09 放到第一个 xff0c 共放置n 1次 include lt stdio h gt void sort int A int N for int i 61 0 i lt
  • 二叉查找树练习代码

    include lt stdio h gt include lt stdlib h gt define Element int typedef struct Node Element data struct Node left right
  • ncre不能支付

    NCRE支付的时候点击支付按钮没反应 xff0c 这是怎么回事 xff1f 这是因为浏览器把它当成垃圾网站给拦截了 xff0c 你可以换个浏览器也可以找找有没有被阻止的网页 我用的是Google的Chrome xff0c 以它为例示范一下
  • 插入排序练习代码

    include lt stdio h gt void sort int A int n int i j tmp for i 61 1 i lt n i 43 43 tmp 61 A i for j 61 i j gt 0 j if tmp
  • 希尔排序练习代码

    include lt stdio h gt void sort int A int n int i j tmp increment for increment 61 n 2 increment gt 0 increment 61 2 for
  • 二叉树、树、森林之间的转化

    树转二叉树 将孩子作为左孩子 xff0c 将第一个兄弟作为右孩子 二叉树转树 将左孩子的右孩子作为自己的孩子 森林转二叉树 与转树差不多 xff0c 唯一需要注意的是要把第二棵树的根节点作为第一棵树的一个兄弟 二叉树转森林 把右孩子断开成一
  • 最小堆练习代码

    include lt stdio h gt include lt stdlib h gt define INF 100000 define MinData 10 typedef int Element typedef struct Node
  • 不带头结点的单链表逆置操作

    reverse函数负责逆置工作 include lt stdio h gt include lt stdlib h gt typedef struct Node int data struct Node next Node List voi
  • 我的第一个Python程序

    突然想学Python了 xff0c 今天开始学习 xff0c 编出了我的第一个Python程序 calculate the area and circumference of a circle from its radius import