I was trying to program in swift through a windows swift compiler and was researching how can i call the user to input a data. I tried to use readLine() but if i use this function without a if condition, it return a optional value, but if i use the if condition, i cant call for the input value out of the condition
if let str = readLine()
print("Hello \(str), welcome to my code!")
E:\IOS\SWIFT\docs\print.swift:8:7: error: use of unresolved identifier 'str'