-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contents.swift
63 lines (41 loc) · 922 Bytes
/
Contents.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import UIKit
// Variables & Constants
// snake_case
// camelCase
// let immutable
// var mutable
// --------- PART 1 ---------
//Değişken tipleri, değişkenler & sabitler
// String
var userName = "James"
userName.append("o")
userName.lowercased()
userName.uppercased()
print(userName)
var userSurname = "Hetfield"
userName = "Lars"
print(userName)
// integer & double & float
// integer
let userAge = 50
let myNumber = 4
userAge / myNumber
// double
let userAgeD = 50.0
let myNumberD = 4.0
userAgeD / myNumberD
// boolean
var myBoolean = false
myBoolean = true
// --------- PART 2 ---------
// Değişken tipini önden belirlemek
var myString : String = "50"
let anotherNumber : Int = 10
let stringNumber : String = String(20)
// define ettik
let myVariable: String
// initialization ettik
myVariable = "Test"
let myUpperVariable = myVariable.uppercased()
print(myUpperVariable)
print(myVariable)