In [3]:
n = int(input('Pleasse input an integer,and end with Enter.'))
i = 0
total = 0

while i < n:
    i = i + 1
    total = total + i
    
print(total)


Pleasse input an integer,and end with Enter.10
55

In [1]:
name = input('Please input your name,and end with Enter.')
print('Hello', name)

n = int(input('Please input an integer,and end with Enter.'))
m = int(input('Please input an integer,and end with Enter.'))

print('This is the sum of two number:', m+n)
print('Goodbye!', name)


Please input your name,and end with Enter.Haloviva
Hello Haloviva
Please input an integer,and end with Enter.1
Please input an integer,and end with Enter.2
This is the sum of two number: 3
Goodbye! Haloviva

In [7]:
n=int(input('Please input an integer,and end with Enter.'))
i=0
j=0
total=0

while i<n:
    j=int(input('Please input an integer,and end with Enter.'))
    i=i+1
    total=total+j
    
print('This is the sum of these numbers:',total)


Please input an integer,and end with Enter.3
Please input an integer,and end with Enter.1
Please input an integer,and end with Enter.2
Please input an integer,and end with Enter.3
This is the sum of these numbers: 6

In [1]:
i=0
m=0

while  i==m: 
    n=int(input('Please input an integer,and end with Enter'))
    print('if you do not want to input numbers,please input out,if you want to continue inputing,please input in')
    m=input()
    if 'out'==m:
        m=1
    else:
        m=0


Please input an integer,and end with Enter1
if you do not want to input numbers,please input out,if you want to continue inputing,please input in
in
Please input an integer,and end with Enter2
if you do not want to input numbers,please input out,if you want to continue inputing,please input in
out

j=0 m=0 n=0 b=0 a=0

while i==j: print('Please input an integer,and end with Enter.') a=int(input()) m=m+a n=na if m<a and n<aa: j=1 else: j=0


In [ ]:
i=0
j=0 
m=0 
n=0 
b=0 
a=0
while i==j: 
    print('Please input an integer,and end with Enter.') 
    a=int(input()) 
    m=m+a 
    n=n*a 
    if m<a and n<a*a: 
        j=1 
    else:
        j=0


Please input an integer,and end with Enter.
1
Please input an integer,and end with Enter.
2
Please input an integer,and end with Enter.
10
Please input an integer,and end with Enter.

print('Please input your name.') name=input() print('Please input your birthday.') month=int(input()) day=int(input())

if month==3: if day<=31 and day>=21: print('白羊座') if month==4: if day>=1 and day<=19: print('白羊座') if month==4: if day<=30 and day>=20: print('金牛座') if month==5: if day>=1 and day<=20: print('金牛座') if month==5: if day<=31 and day>=21: print('双子座') if month==6: if day>=1 and day<=21: print('双子座') if month==6: if day<=30 and day>=22: print('巨蟹座') if month==7: if day>=1 and day<=22: print('巨蟹座') if month==7: if day<=31 and day>=23: print('狮子座') print(name,'你是非常有性格的金牛座') if month==8: if day>=1 and day<=22: print('狮子座') print(name,'你是非常有性格的金牛座') if month==8: if day<=31 and day>=23: print('处女座') if month==9: if day>=1 and day<=22: print('处女座') if month==9: if day<=30 and day>=23: print('天秤座') if month==10: if day>=1 and day<=23: print('天秤座') if month==10: if day<=31 and day>=24: print('天蝎座') if month==11: if day>=1 and day<=22: print('天蝎座') if month==11: if day<=30 and day>=23: print('射手座') if month==12: if day>=1 and day<=21: print('射手座') if month==12: if day<=31 and day>=22: print('摩羯座') if month==1: if day>=1 and day<=19: print('摩羯座') if month==1: if day<=31 and day>=20: print('水瓶座') if month==2: if day>=1 and day<=18: print('水瓶座') if month==2: if day<=28 and day>=19: print('双鱼座') if month==3: if day>=1 and day<=20: print('双鱼座')


In [1]:
print('Please input your name.')
name=input()
print('Please input your birthday.')
month=int(input())
day=int(input())

if month==3:
    if day<=31 and day>=21:
        print('白羊座')
if month==4:
    if day>=1 and day<=19:
        print('白羊座')
if month==4:
    if day<=30 and day>=20:
        print('金牛座')
if month==5:
    if day>=1 and day<=20:
        print('金牛座')
if month==5:
    if day<=31 and day>=21:
        print('双子座')
if month==6:
    if day>=1 and day<=21:
        print('双子座')
if month==6:
    if day<=30 and day>=22:
        print('巨蟹座')
if month==7:
    if day>=1 and day<=22:
        print('巨蟹座')
if month==7:
    if day<=31 and day>=23:
        print('狮子座')
        print(name,'你是非常有性格的金牛座')
if month==8:
    if day>=1 and day<=22:
        print('狮子座')
        print(name,'你是非常有性格的金牛座')
if month==8:
    if day<=31 and day>=23:
        print('处女座')
if month==9:
    if day>=1 and day<=22:
        print('处女座')
if month==9:
    if day<=30 and day>=23:
        print('天秤座')
if month==10:
    if day>=1 and day<=23:
        print('天秤座')
if month==10:
    if day<=31 and day>=24:
        print('天蝎座')
if month==11:
    if day>=1 and day<=22:
        print('天蝎座')
if month==11:
    if day<=30 and day>=23:
        print('射手座')
if month==12:
    if day>=1 and day<=21:
        print('射手座')
if month==12:
    if day<=31 and day>=22:
        print('摩羯座')
if month==1:
    if day>=1 and day<=19:
        print('摩羯座')
if month==1:
    if day<=31 and day>=20:
        print('水瓶座')
if month==2:
    if day>=1 and day<=18:
        print('水瓶座')
if month==2:
    if day<=28 and day>=19:
        print('双鱼座')
if month==3:
    if day>=1 and day<=20:
        print('双鱼座')


Please input your name.
Halovivo
Please input your birthday.
1
2
摩羯座

In [1]:
a=0
print('请输入两个整数')
m=int(input())
n=int(input())
print('如果你想求和请输入sum,如果你想求积请输入product,如果你想求余请输入remainder。')
b=input()

if b=='sum':
    a=m+n
elif b=='product':
    a=m*n
elif b=='remainder':
    a=m%n
else:
    a=m/n

print(a)


请输入两个整数
1
2
如果你想求和请输入sum,如果你想求积请输入product,如果你想求余请输入remainder。
sum
3

In [2]:
print('请输入北京PM2.5数值')
a=int(input())
if a<=100:
    print('今天是个好天气,可以尽情出去游玩')
elif a<=200:
    print('请适当在外活动,必要时戴口罩')
elif a<=300:
    print('尽量减少外出,出门戴口罩')
else:
    print('尽量不要出门,不要在外停留,戴口罩')


请输入北京PM2.5数值
50
今天是个好天气,可以尽情出去游玩

In [11]:
string=input()
if string.endswith('x'):
    print(string + 'es')
elif string.endswith('s'):
    print(string + 'es')
elif  string.endswith('h'):
    if string[-2].endswith('c','s'):
        print(string + 'es')
elif string.endswith('y'):
    print(string[:-1] + 'ies')
else:
    print(string + 's')


apple
apples

In [ ]: