Python练习记录

Python练习记录_第1张图片

# -*- coding: utf-8 -*-
n = eval(input())
s = "Hello world"

if n == 0:
    print(s)

elif n > 0:
    for i in range(len(s)):
        if i % 2 == 0:
            print(s[i], end = '')
        else:
            print(s[i])

else:
    for i in s:
        print(i)

Python练习记录_第2张图片

s = input()
print("{:.2f}".format(eval(s)))

你可能感兴趣的:(Python,python)