0

Can you help me with my code?

Ok, so an error occurs in a Kotlin code: assignment is not an expression, and it has to have an expression (sorry if a have a mistake, but I remember like that) Can you help me to solve the problem (The code is an aswer for the second task after Kotlin quiz test #2) https://code.sololearn.com/cxgn0RI9HvLp/?ref=app

14th Nov 2021, 11:33 PM
SelfyTheMentalist
SelfyTheMentalist - avatar
3 Respuestas
+ 4
1. You can remove lines 5 and 6. 1 they don't need !! as they're already unwrapped non-null. 2 they don't do anything as they're not saved back to the variables. 2. Your error is due to the use of parentheses ( ) for your nested else block instead of curly braces { }.
15th Nov 2021, 12:14 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
ChaoticDawg well, thanks a lot, I haven't noticed such error
15th Nov 2021, 7:09 AM
SelfyTheMentalist
SelfyTheMentalist - avatar
0
ChaoticDawg well, but when I run it the case #4 gives me an error, do you know someone's code from which I can try to realize my mistake?
15th Nov 2021, 7:21 AM
SelfyTheMentalist
SelfyTheMentalist - avatar