0
Can ReadLine() be used in if statements.
I want the user to input their ethnicity and then from what they enter it prints the out their home country. Any way how I can do this I tried using an if statement but no luck.
2 Answers
+ 2
Can you show us the code sample. Than we can help you with it.
+ 1
let ethnicity = readLine()
if ethnicity == "African" {
print("Africa")
}
if ethnicity == "Chinese"
{
print("china")
}