首页 > > 详细

COMP9021辅导、Python辅导设计辅导

COMP9021 PRINCIPLES OF PROGRAMMING Term 3, 2022
$ python3 quiz_3.py
Input an arity : 0
Input a word: f_1
The word is invalid.
$ python3 quiz_3.py
Input an arity : 0
Input a word: ()
The word is invalid.
$ python3 quiz_3.py
Input an arity : 0
Input a word: function_of_arity_one(hello)
The word is invalid.
$ python3 quiz_3.py
Input an arity : 1
Input a word: f)
The word is invalid.
$ python3 quiz_3.py
Input an arity : 1
Input a word: f[a]
The word is invalid.
$ python3 quiz_3.py
Input an arity : 2
Input a word: f(a, g(b))
The word is invalid.
1$ python3 quiz_3.py
Input an arity : 3
Input a word: constant
The word is invalid.
$ python3 quiz_3.py
Input an arity : 3
Input a word: f((a,b,c))
The word is invalid.
$ python3 quiz_3.py
Input an arity : 3
Input a word: f(g(a,a), f(a,b))
The word is invalid.
$ python3 quiz_3.py
Input an arity : 3
Input a word: f(g(a,b,c),g(a,b,c),g(a,b,c)
The word is invalid.
$ python3 quiz_3.py
Input an arity : 3
Input a word: f(a, g(a, b, f(a,b,c)), b, c)
The word is invalid.
$ python3 quiz_3.py
Input an arity : 0
Input a word: a
The word is valid.
$ python3 quiz_3.py
Input an arity : 1
Input a word: function_of_arity_one(hello)
The word is valid.
23
$ python3 quiz_3.py
Input an arity : 2
Input a word: F(g(a,a), f(a,b))
The word is valid.
$ python3 quiz_3.py
Input an arity : 3
Input a word: ff(ff(ff(a,b,ff(aa,bb,cc)) , b , ff(a,b,c)) , b , ff(a,ff(a,b,c),c))
The word is valid.
$ python3 quiz_3.py
Input an arity : 4
Input a word: f(a, FF(a, b, fff(a, b, c, FfFf(a,b,c,d)), FfFf(a,b,c,d)), c, d)
The word is valid.

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!