莲藕排骨汤218 2022-03-25 16:44 采纳率: 100%
浏览 22
已结题

关于python的计算题

  1. Using the user input method, enter a number between 1 and10, and print out two results: a) this number multiplied by 2; b)the square of this number.

For example, the following prompt can be displayed:

'Enter a number between 1 and 1O:'

5 (this is your input)

And the output should look like:

The number multiplied by 2 is: 10

The square of this number is: 25

  1. subject = 'Get some dollars!'

In the string above, find out whether it contains the word'dollar' . If yes, print True.

  • 写回答

1条回答 默认 最新

  • x10n9 2022-03-25 17:20
    关注
    
    num=input('Enter a number between 1 and 1O:')
    num=int(num)
    print('The number multiplied by 2 is:',num*2 )
    print('The square of this number is:',num*num)
    

    2.

    subject = 'Get some dollars!'
    if 'dollar' in subject:
        print(True)
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 4月2日
  • 已采纳回答 3月25日
  • 创建了问题 3月25日

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch