I am using some very simple conditionals and it gives me the following error:
unary operator cannot be separated from its operand.
import Foundation
import UIKit
//SENTENCIAS IF
let myNumber = 5
//Una barra invertida y los paréntesis lo que aparece es la variable
//siempre y cuando tengamos un texto
if myNumber >= 5 && <= 10
{
print("\(myNumber) es mayor que 5 y es menor que 10")
} else
{
print("\(myNumber) es mayor que 10")
}
Does anyone know what the error could be?
Your usage is incorrect because you omit the variable to compare in the second condition, after the logical operator.
That is cond1 && cond2, where: