Python考试求助,急急急急急急!!! 100
1.WritethegrammarfordefiningfunctionsinML2.WriteanMLfunctiontocombinetwointegerlistsi...
1.Write the grammar for defining functions in ML
2.Write an ML function to combine two integer lists into one list 展开
2.Write an ML function to combine two integer lists into one list 展开
2个回答
展开全部
1.
print('Hellow world')
2.
# coding=utf-8
print('你好.Python')
3.
print('anywords')
4.
print(' '+'*' * 10) # 输出10个*
for i in range(6): #从1到6循环
print('*') #输出*
print(' '+'*' *10)
5.
IntTest = 11235813
print('IntTest')
print(type(IntTest))
6.
FloatTest = 3.1415
print('FloatTest')
print(type(FloatTest))
7.
StrTest = '我是文本'
print('StrTest')
print(type(StrTest))
8.
a = 10
if a>0:
print('over 0')
elif a == 0 :
print('a=0')
else:
print('smaller than 0')
9.
for i in range(10):
print('循环测试')
10.
def FuncTest():
print ('1')
11.
def FuncTest(Parm1, Parm2, Parm3):
print ('1')
12.
def FuncTest(a, b):
return a+b
def FuncTest2(a, b):
return FuncTest(a, b)
a = 10
b = 10
print(FuncTest2(a,b))
13.
gMainVar = 10
def printNumber(a):
return print(a)
printNumber(gMainVar)
14.
def FuncTest():
a = 10
print(a)
FuncTest()
15.
class Car():
def __init__(self, name, old):
self.name=name
self.old=old
16.
class B():
def __init__(self):
self.sex = 'nv'
def step1(self):
print("B")
17.
class Car():
def __init__(self, name, old):
self.name=name
self.old=old
def print(self):
return print(self.name+'===>'+str(self.old))
def train(self):
self.print()
car=Car('Tom', 11)
car.print()
car.train()
18.
# 异常代码
# a = 1
# b = 2
# function(a, b)
# 异常问题:func为定义
# 解决方法
a = 1
b = 2
def function(a ,b):
return print(a+b)
function(a ,b)
19.
import time
res=time.strftime("%Y-%m-%d %X")
print(res)
print('Hellow world')
2.
# coding=utf-8
print('你好.Python')
3.
print('anywords')
4.
print(' '+'*' * 10) # 输出10个*
for i in range(6): #从1到6循环
print('*') #输出*
print(' '+'*' *10)
5.
IntTest = 11235813
print('IntTest')
print(type(IntTest))
6.
FloatTest = 3.1415
print('FloatTest')
print(type(FloatTest))
7.
StrTest = '我是文本'
print('StrTest')
print(type(StrTest))
8.
a = 10
if a>0:
print('over 0')
elif a == 0 :
print('a=0')
else:
print('smaller than 0')
9.
for i in range(10):
print('循环测试')
10.
def FuncTest():
print ('1')
11.
def FuncTest(Parm1, Parm2, Parm3):
print ('1')
12.
def FuncTest(a, b):
return a+b
def FuncTest2(a, b):
return FuncTest(a, b)
a = 10
b = 10
print(FuncTest2(a,b))
13.
gMainVar = 10
def printNumber(a):
return print(a)
printNumber(gMainVar)
14.
def FuncTest():
a = 10
print(a)
FuncTest()
15.
class Car():
def __init__(self, name, old):
self.name=name
self.old=old
16.
class B():
def __init__(self):
self.sex = 'nv'
def step1(self):
print("B")
17.
class Car():
def __init__(self, name, old):
self.name=name
self.old=old
def print(self):
return print(self.name+'===>'+str(self.old))
def train(self):
self.print()
car=Car('Tom', 11)
car.print()
car.train()
18.
# 异常代码
# a = 1
# b = 2
# function(a, b)
# 异常问题:func为定义
# 解决方法
a = 1
b = 2
def function(a ,b):
return print(a+b)
function(a ,b)
19.
import time
res=time.strftime("%Y-%m-%d %X")
print(res)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询