Coding Quiz
Level 4, 2025-09-14
All code is in Python. Operations with strings and numbers are not allowed. Ordering of string characters: !,A,1,a (meaning 'A' < 'a').
Special Symbols: Blank: Space: Error: E
def makeString(A,A): A=0 B="" while A < A A = A + 1 B = B + A return A
VAR = makeString("F",5) VAR = VAR + makeString("f",2) Print(VAR)
| [2]
|
|
def DoSum(Y,F,Z) B=Y + Z + F Print(B)
DoSum(5,3,8)
| [1]
|
|
Y=2 Print(Y)
def MyFunction (Y): Y=Y+3 Print(Y)
MyFunction(2) Print(Y+3)
| [1]
|
|
Q = "1" Q = "6" VAR = 4 X = 3 if X<Q: Print(1) elif Q<X: Print(2) elif Q>Q: Print(3) else: Print(4)
| [1]
|
|
def doThis(F): A=F * 3 A = doThat(A) return A
def doThat(Y): B=Y * 3 return B
B = doThis(7) B = doThis(B) Print(B)
| [2]
|
|
F = "!" Y = "A" F = 7 Y = 9 Q = F+Y Print(Q)
| [1]
|
|
Y = 5 A = 7 if Y > 3: Print("1") if A >= 3: Print("2") else: Print("3") elif Y != 8: Print("4") if A != 7: Print("5") else: Print("6") else: Print("7") if A != 1: Print("8") else: Print("9")
| [2]
|
|
def Hello(X,type) if (!X) return if (type=="good"): VAR="Hi " elif (type=="bad"): VAR="Boo " else: VAR="Bye" return VAR + " " + X
F = Hello("","ok") Print(F)
| [1]
|
|
def makeString(B,B): Q=0 E="" while Q < B Q = Q + 1 E = E + B return B
Y = makeString("b",1) Y = Y + makeString("B",6) Print(Y)
| [2]
|
|
def Hello(VAR) X="Hi " + VAR Print(X)
Hello("Octavian")
| [1]
|
|
def Hello(Z,type) if (type=="good"): VAR="Hi " else: VAR="Bye" Print(VAR+" "+Z)
Hello("Jenny","bad")
| [1]
|
|
def doThis(Y): B=Y + 6 B = doThat(B) return B
def doThat(VAR): F=VAR + 6 return F
Q = doThis(3) Print(Q)
| [2]
|
|
def doThis(Q): E=Q + 5 E = doThat(E) return E
def doThat(E): F=E * 4 return F
Y = doThis(3) Y = doThis(Y) Print(Y)
| [2]
|
|
|
|