SHARE
TWEET

Untitled

a guest Sep 17th, 2019 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import UIKit
  2.  
  3. //String = "asdnad  23bkj4b234 asdasd askdaksmd 123*7324234"
  4. //Double, Float = 0.1231231233123213123123123123123123
  5. //Int = 213123123
  6. //Bool = true false
  7. //
  8. //Double, Float, Bool, Int
  9. //
  10. //var name: String = "Moscow"
  11. //var name = "Moscow"
  12. //
  13. //var number: Double = 0.12
  14. //
  15. //
  16. //var intNumber = 123
  17. //
  18. //var boolObject = false
  19.  
  20. //var name: Double?
  21. //var name: Double? = nil
  22. //name = 0.123123
  23. //name = 123123
  24.  
  25.  
  26. // var name: Double? = nil
  27.  
  28. //var name: Double?
  29. //name = nil
  30. //
  31. //if let value = name {
  32. //    print(value)
  33. //}
  34. //
  35. //var name: String?
  36.  
  37. // && - и
  38. // || - или
  39.  
  40. let age = 21
  41. let country = "фывдлываи 23лциокж 23"
  42.  
  43. if (age >= 18) && (country == "Russia") {
  44.     print("Совершеннолетний в России")
  45. } else if (age >= 21) && (country == "USA") {
  46.     print("Совершеннолетний в Америке")
  47. } else {
  48.     print("Непонятно")
  49. }
  50.  
  51. let eatName = "Помидор"
  52. var isVegetable = false
  53. var isFruit = false
  54.  
  55. if (eatName == "Помидор") || (eatName == "Огурец") {
  56.     isVegetable = true
  57. } else if (eatName == "Мандарин") || (eatName == "Апельсин") {
  58.     isFruit = true
  59. }
  60.  
  61. if (isFruit == true) || (isVegetable == true) {
  62.     print("Это еда")
  63. } else {
  64.     print("Это не еда")
  65. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top