编辑代码

#!/usr/bin/python
# Write Python 3 code in this online editor and run it.

import math

print("cacl list: ", 100+200,", ", 2**3)

print('''line1
line2
   line3''')


t = "007"
print("t is ",t)

s3 = 'Hello, "Bart"'
s4 = '''Hello,
Lisa!'''
print(s4)
print("=========")

print('%2d-%03d' % (300, 1))
print('%.2f' % 3.1415926)
print("=========")


r = (85-72)/72*100
print("成绩提升百分点: %.2f %%" %  r)
print(f"成绩提升百分点: {r:.3f} %" )
print("=========")

L = [
    ['Apple', 'Google', 'Microsoft'],
    ['Java', 'Python', 'Ruby', 'PHP'],
    ['Adam', 'Bart', 'Lisa']
]

print(L[0][0],L[0][1],L[0][2],"\n",
      L[1][0],L[1][1],L[1][2],"\n",
      L[2][0],L[2][1],L[2][2])
print("=========")

age = 8
if age>18:
    print("your age is ", age, "adalt")
else:
	print("your age is ", age, "not adalt")
print("=========")

sum = 0
aa = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
bb = list(range(101))
for i in bb:
	sum +=i
print(sum)
print("=========")

L = ['Bart', 'Lisa', 'Adam']
for i in L:
	print(f"hello! {i}")
print("=========")

a1 = (1,2,3)
d = {0, a1}
print(d)
print("=========")

n1 = 255
n2 = 1000
print(hex(n1),hex(n2))
print("=========")

aa1 = list(range(5))
bb1 = list(range(1,4)) 
print(aa1)
print(bb1)
print("=========")
n1 = 255
n2 = 1000
print(hex(n1),hex(n2))
print("=========")