简体   繁体   English

为什么我不能在 1 行中使用 python 打印句子和变量值?

[英]why i cant print sentence and variable value in 1 line use python?

Im try to calculating available subnet with python.我尝试用python计算可用子网。 just simple call but error.只是简单的调用但错误。

    print ("the IP is valid")
    result = (2 ** (32 - int(mask)) - 2)
    print ("net available: ".format(result))
print ("the IP is valid")
result = (2 ** (32 - int(mask)) - 2)
print ("net avaiable: {0}".format(result))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能在python命令行中使用& - why cant i use & in python command line 在“if”语句中尝试 Python 的“None”,但我无法打印消息:“print(“Any value.!”)”将 None 与空值进行比较,为什么我不能? - Trying Python's "None" in a "if" statement, but i cant print the message: "print("Any value.!")" comparing None with an empty Value, why i cant? python无法使用函数来更改变量的值 - python cant use a function to change the value of a variable Python-在新行上打印每个句子 - Python - Print Each Sentence On New Line 为什么我不能使用这个 python 应用程序? - Why i cant use this python application? 为什么当我使用 end 参数时,python print() 函数会在行尾打印一个 %? - Why does python print() function print a % at the end of the line when I use the end parameter? 为什么我不能使用python在b函数中打印aa - why i cant print aa in b function using python 为什么我不能在最后打印板? (井字游戏蟒蛇) - Why i cant print the board at the end? (tic tac toe python) 我无法打印禁用文本框内的值 = Python selenium - I cant print the value inside of the disabled textbox = Python selenium 当我不使用打印时,为什么 Python 会在循环体中打印一个值? - Why does Python print a value in the body of a loop when I don't use print?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM