Ask coding questions

← Back to all posts
I can't seem to get this Ternary Operator correct
alope1

Need help figuring out what I am doing wrong and how to fix it. There's two files and I'm aware I can't run both of them, I'm using two so that I can compare.

Voters
alope1
Comments
hotnewtop
theangryepicbanana

It seems to run for me

alope1

@theangryepicbanana I added another file. main2.swift.

theangryepicbanana

@alope1 well repl.it will only run the main.swift file, so you may want to move the code from main2.swift to main.swift

alope1
Vandesm14

There is only one file.

alope1

@Vandesm14 sorry, I added my another file with the Ternary Operator that I created. main2.swift file.