def Qiang(a,b,c):\n",
" \n",
" d=bb-4ac\n",
" r1=(-b+(bb-4ac)**1/2)/2a\n",
" r1=(-b-(bb-4ac)**1/2)/2*a\n",
" print(“判别式结果为:%d”%d)\n",
" if d > 0:\n",
" print(“有俩个实根为:%d%d”%r1%r2)\n",
" elif d==0:\n",
" print(“有一个根为:%d”%r1)\n",
" else :\n",
" print(“The equation has no real roots”)\n",
“def Start():\n”,
" a=int(input (“请输入a的值为:”))\n",
" b=int(input (“请输入b的值为:”))\n",
" c=int(input (“请输入c的值为:”))\n",
" Qiang(a,b,c)\n",
“Start()\n”,
" \n"
“def Shixin(a):\n”,
" import random\n",
" num1=random.randint(0,100)\n",
" num2=random.randint(0,100)\n",
“\n”,
" if a==num1+num2:\n",
" print(“答案正确”)\n",
" else:\n",
" print(“答案错误”)\n",
“def Start():\n”,
" a=int(input (“请输入这俩个数的和为:”))\n",
" Shixin(a)\n",
“Start()”
“def Shixin(a):\n”,
" if a0:\n",
" print(“星期日”)\n",
" elif a1:\n",
" print(“星期一”)\n",
" elif a2:\n",
" print(“星期二”)\n",
" elif a3:\n",
" print(“星期三”)\n",
" elif a4:\n",
" print(“星期四”)\n",
" elif a5:\n",
" print(“星期五”)\n",
" else :\n",
" print(“星期六”)\n",
" \n",
" \n",
“def Start(): \n”,
" c=int(input(“提示请输入今天是:(星期天输:0,星期一输:1,…星期六输:6)”))\n",
" b=int(input(“提示请输入到未来某天的天数为:”)) \n",
" a=(c+b)%7\n",
" Shixin(a)\n",
"Start() "
“def Start(): \n”,
" a=int(input(“提示请输入一个数”))\n",
" b=int(input(“提示请输入一个数”))\n",
" c=int(input(“提示请输入一个数”))\n",
" list = []\n",
" list.append(a)\n",
" list.append(b)\n",
" list.append©\n",
" print(list)\n",
" list.sort()\n",
" print(list)\n",
" \n",
“Start()\n”
a=int(input(“提示请输入第一种包装的重量为:”))\n",
" b=int(input(“提示请输入第一种包装的价格为:”))\n",
" c=int(input(“提示请输入第二种包装的重量为:”))\n",
" d=int(input(“提示请输入第二种包装的价格为:”))\n",
" if a/b > c/d:\n",
" print (“第一种货物”)\n",
" else :\n",
" print(“第二种货物”)\n",
" "
“def Shixin(a):\n”,
" import random\n",
" num1=random.randint(0,1)\n",
" \n",
“\n”,
" if a==num1:\n",
" print(“答案正确”)\n",
" else:\n",
" print(“答案错误”)\n",
“def Start():\n”,
" a=int(input (“请输入硬币为正面还是侧面:(正面为0,侧面为1)”))\n",
" Shixin(a)\n",
“Start()”
“def Shixin(a):\n”,
" import random\n",
" num1=random.randint(0,2)\n",
" \n",
" if a==num1:\n",
" print(“平局”)\n",
" elif a>:\n",
" print(“答案错误”)\n",
“def Start():\n”,
" a=int(input (“请输入剪刀石头布:(剪刀为0,石头为1,布为2)”))\n",
" Shixin(a)\n",
“Start()”
week = [‘Saturday’,‘Sunday’,‘Monday’,‘Tuesday’,‘Wendnesday’,‘Thursday’,‘Friday’]
if month == 1:
month = 13
if month ==2:
month = 14
year = year - 1
a = int(days+((26*(month+1))//10)+(year%100)+((year%100)/4)+((year//100)/4)+5*year//100)%7
day = week[a]
print(‘Day of the week is %s’%day)
def Start():
year = int(input(‘Enter year(e.g…2018):’))
month = int(input(‘Enter month(1-12):’))
days = int(input(‘Enter the day of the month(1-31):’))
yonghu(year,month,days)
def daxiao():
import numpy as np
pai = np.random.choice([‘Ace’,‘2’,‘3’,‘4’,‘5’,‘6’,‘7’,‘8’,‘9’,‘10’,‘Jack’,‘Queen’,‘King’])
hua = np.random.choice([‘梅花’,‘红桃’,‘方块’,‘黑桃’])
print(“The card you picked is the %s of %s”%(pai,hua))
def Start():
daxiao()
Start()
def panduan(shu):
a = shu % 10 * 100 + shu // 10 % 10 * 10 + shu // 100
if shu == a:
print(’%d是回文数’%shu)
else:
print(’%d不是回文数’%shu)
def start():
shu = int(input('请输入一个三位数: '))
panduan(shu)
start()
def s(a,b,c):
if a < b + c and b < a + c and c < a + b:
sum = a + b + c
print(“三角形的周长是:%d”%sum)
else:
print(“您输入的边长是非法的”)
def Start():
a = int(input("请输入三角形的边长:"))
b = int(input())
c = int(input())
s(a,b,c)