Created
November 1, 2021 23:10
-
-
Save swdevbali/7f277c19f9dd9f09526e9a144afb5fc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Conditional statement | |
// https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html | |
if tomato.name.contains("Swift") { | |
print("Good for you!") | |
}else{ | |
print("That's fine. You can use Flutter or ReactNative too. It even cross platfrom solution!") | |
} | |
// Loop | |
let languages = ["Python", "Golang", "Swift", "Java"] | |
for l in languages{ | |
print(l + " is good!") | |
} | |
// https://pypl.github.io/PYPL.html | |
let popularity_of_languages = ["Python": 1, "Golang": 13, "Swift": 9, "Java":2] | |
for (lang, pop) in popularity_of_languages{ | |
print(lang + " is number " + String(pop)) | |
} | |
for rank in 1...9{ | |
if (rank==9){ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment