print (45678+0x12fd2)
print ('Learn Python in imooc)
print (100<99)
print (0xff==255)
print ('Learn Python in imooc)
print (100<99)
print (0xff==255)
2019-02-08
import math
def quadratic_equation(a, b, c):
(tab) x1 = ((-b) + math.sqrt(b**2 - 4*a*c))/(2*a)
(tab)x2 = ((-b) - math.sqrt(b**2 - 4*a*c))/(2*a)
(tab)return x1,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
#tab键啊,python对缩进要求太严格了……
def quadratic_equation(a, b, c):
(tab) x1 = ((-b) + math.sqrt(b**2 - 4*a*c))/(2*a)
(tab)x2 = ((-b) - math.sqrt(b**2 - 4*a*c))/(2*a)
(tab)return x1,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
#tab键啊,python对缩进要求太严格了……
2019-02-04
import math
def quadratic_equation(a, b, c):
x1 = ((-b) + math.sqrt(b**2 - 4*a*c))/(2*a)
x2 = ((-b) - math.sqrt(b**2 - 4*a*c))/(2*a)
return x1,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
#还是要学好数学……
def quadratic_equation(a, b, c):
x1 = ((-b) + math.sqrt(b**2 - 4*a*c))/(2*a)
x2 = ((-b) - math.sqrt(b**2 - 4*a*c))/(2*a)
return x1,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
#还是要学好数学……
2019-02-04
# _*_ coding: utf-8 _*_
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''.encode('utf-8')
print u'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''.encode('utf-8')
2019-02-03
怎么这里这么多人说“Python 3运行不了”,你们看前面的视频了吗?教程用的是Python 2.7.8,那些Python 3.x的请出去!
2019-02-02
enumerate()函数的原型是enumerate(iterable[, start]) -> iterator,后面的start参数是索引开始的编号,使用enumerate(L, 1)可以直接从1开始生成索引。
已采纳回答 / Legend_1949
这是Python 2的代码啊!你用*.html作为后缀、让NotePad++将源代码作为HTML进行解析,怎么可能运行得出来?答案所示的代码在Linux Python 2.7.15+上运行出来应该是这样的:<...code...>结果就是HTML网页...
2019-02-02