Photo by http://sheriframadan.com/

Learn Swift Together / Variable and Data Types

cemal tüysüz
2 min readMay 5, 2021

Hello everyone , in this article I will tell you variables and data types for Swift Programming Language.

If you just started programming , this article may not be for you.

Click to get information about this article series.

Data Types

A. Int

This data type refers to integers.

B. Double

This data type refers to decimal numbers

C. Float

This data type is like Double. Float for lower numbers.

D. Bool

This data type indicates the situation. Takes true or false values.

E. String

This data type is indicates textual expressions.

F. Character

This data type indicates a single character.

Variable Definition Types

A. Creating variables without specifying a data type.

B. Creating variables with specifying a data type.

C. Define variables without value

D. Create multiple variables in single line

Constants

If we want the value of the variable not to be changed later, the variable is defined as ‘let’.

The program will fail if you change it value

Arithmetic operators

We use it for mathematical operations.

Type Conversions

A. Conversion from numeric to numeric

B. Conversion from numeric to textual

C. Conversion from textual to numeric

Tuples :

Tuples are structure that allows us to define more than one value for a variable. It’s like lists.

We come to the end of the article. See you in the next article :)

--

--

cemal tüysüz
cemal tüysüz

No responses yet