python无效语法报错的原因,python无效语法解决方法

大家好,本文将围绕python无效语法string怎么办展开说明,python无效语法中一个字母是一个很多人都想弄明白的事情,想搞清楚python无效语法报错的原因需要先了解以下几个事情。

我不明白为什么我在这个程序中得到一个无效的语法错误。我想这很简单,但我对这个很陌生用python画小猫。整个过程如下:# Welcome Message

print ("Hello and welcome to the Plesha EasyTube Wizard!")

print ("Today we will be gathering measurements from you to determine the \

materials and cost of your tubes.")

print ("All measurements should be in centimeters!")

print ()

# Collect user inputs

height = float(input("Let's begin: What is the height of you desired tube? "))

radius = float(input("And what is the radius? "))

count = int(input("How many would you like? "))

# Set Constants

steelPrice = 0.14

rubberPrice = 0.02

# Calculations

import math

singleTubeVol = math.pi * (radius ** 2) * height

allTubeVol = singleTubeVol * count

singleTubeSurface = (2 * math.pi * (radius ** 2)) + (2 * math.pi * radius * height)

allTubeSurface = singleTubeSurface * count

singleTubeRubber = 2 * math.pi * (radius + 0.5) * height

allTubeRubber = singleTubeRubber * count

steelCost = steelPrice * allTubeSurface

rubberCost = rubberPrice * allTubeRubber

totalCost = rubberCost + steelCost

# Output

V------ here is where the problem is

print ("You wanted ", count " tubes in the dimesions ", height \

" centimeters by ", radius " centimeters (radius).")

print ("The volume of a single tube of your specifications is: ", singleTubeVol)

print ("The total volume of your tube order will be ", allTubeVol)

print ("You will require ", allTubeSurface " square centimeters of steel. Totalling "\

, steelCost "in price." )

print ("You will require ", allTubeRubber " square centimeters of rubber. Totalling "\

, rubberCost " in price." )

print ("Your total cost for this order will be ", totalCost)

我很感激对新手的帮助。在

  • 21
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值