欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

我写的第一行python

程序员文章站 2022-06-10 20:43:18
...
#! /usr/bin/env python
#coding=utf-8
from pip._vendor.distlib.compat import raw_input
def isParity(x):
    if x%2==0:
        print x,"是偶数"
    else:
        print x,"是奇数" 

isParity(6)
'''
def f(x):
    result = 0
    while(x):
        result = result + x
        x = x-1
    return result
print(f(9))

input_message = raw_input("请输入你的名字:")

print(input_message)


for n in range(20):
    if n%2==0:
        print("偶数有:",n)

'''