課程
/后端開發
/Python
/初識Python
#Enter a code
print 'oxff+0x12fd2
print'Learn Python in imooc'
print '100<99
print 'oxff==255
'False
'True
2020-02-11
源自:初識Python 3-1
正在回答
應該是
print 45678+0x12fd2print"Learn Python in imooc"print 100<99print 0xff==255
在輸入字符串時用引號,求值和布爾值時不需要用引號
print(45678?+?int('0x12fd2',16)) print('Learn?Python?in?imooc') if?(100?<?99): ????print('true') else: ????print('false') if(0xff?==?255): ????print('true') else: ????print('false') ''' 總結: 1、十六進制字符串轉換成十進制?int(x,16) 2、pinrt()?需要添加() 3、字符串轉換成整數 int('10')???????#?字符串轉換成10進制整數 int('10',16)????#?字符串轉換成16進制整數 int('0x10',16)??#?字符串轉換成16進制整數 int('10',8)?????#?字符串轉換成8進制整數 int('010',8)????#?字符串轉換成8進制整數 int('10',2)?????#?字符串轉換成2進制整數 4、整數之間的轉換 hex(16)?????#?10進制轉16進制 oct(8)??????#?10進制轉8進制 bin(8)??????#?10進制轉2進制 '''
print 45678+0x12fd2print'Learn Python in imooc'print 100<99Falseprint 0xff==255True
舉報
學python入門視頻教程,讓你快速入門并能編寫簡單的Python程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2020-02-11
應該是
print 45678+0x12fd2
print"Learn Python in imooc"
print 100<99
print 0xff==255
在輸入字符串時用引號,求值和布爾值時不需要用引號
2020-02-16
2020-02-11
print 45678+0x12fd2
print'Learn Python in imooc'
print 100<99
False
print 0xff==255
True