• python_day1


    昨天装系统到12点没写,今天补上

    第一题:
    Celsius=float(input('Enter a degree in Celsius: 43'))
    Fahrenheit=(9/5) * Celsius + 32
    print('{}cesius ={}fahrenheit'.format(Celsius,Fahrenheit))
    第二题:
    import math  ##不写π有偏差
    radius,length=map(float,imput().split(','))
    area=radius * radius * π
    volume=area * length
    print('The area is %.4f'%(area))
    print('The volume is %.1f'%(volume))
     
    第三题:
    feet=float(input('Enter value for feet:16.5'))
    meter=feet*0.305
    print('{}feet is {}metres'.format(feet,meter))

    第四题:
    M=float(input('Enter the amount of water in kilograms:'))
    initial=float(input('Enter the initial temperature:'))
    final=float(input('Enter the final temperature:'))
    Q=M * (finalTemperature - initialTemperature) * 4184
    print('The energy needed is 1625484.0{}'.format(Q))
    第五题:
    import math
    e,g=map(float,input('Enter balance and interest rate (e.g.,3 for 3%):').split(','))
    lixi=e*(g/1200)
    print('The interest is %.5f'%(lixi))
    第六题
    import math
    v0,v1,t=map(float,input('Enter v0,v1,and t:').split(','))
    average=(v1-v0)/t
    print('The average acceleration is &.4f'%(average))
    第七题
    a=float(input('Enter the monthly saving amount:'))
    b=0
    for i in range(6):
    b=(a+b)*(1+0.00417)
    print('After the sixth month,the account value is%.2f'%b)
     
    第八题
    a=float(input('Enter a number between 0 and 1000:'))
    ge=a%10
    shi=a//10%10
    bai=a//100
    b=ge+shi+bai
    print('The sum of the digits is:%d'%(b))
     
     
    这是在下的课后习题,每一题都有认真去写,暂时先写这么多,后面会有补充
  • 相关阅读:
    动态分配内存与静态分配内存
    指针的指针
    cpp与其他语言相比较
    数组是什么
    cocos2d-x 2.1.4 项目配置过程
    显示隐藏文件 osx 10.10
    Windows 10 SDK 10.0.10158
    Office 2016 (Preview)
    Windows 10 SDK 10.0.10069 : The installer failed. User cancelled installation. Error code: -2147023294
    用系统工具sxstrace检查缺少的VC运行时组件
  • 原文地址:https://www.cnblogs.com/wangzhehui/p/11279777.html
Copyright © 2020-2023  润新知