Discuss / Python / 作业

作业

Topic source

Sayiod

#1 Created at ... [Delete] [Delete and Lock User]
# -*- coding: utf-8 -*-

#请利用Python内置的hex()函数把一个整数转换成十六进制表示的字符串:
n1 = 255
n2 = 1000
a = hex(n1)
b = hex(n2)
print('%s translate hex: %s, %s translate hex: %s' % (n1, a, n2, b))

  • 1

Reply