Working with variables
now we make some fun with variable, variable are label which is can defining the some value, its like some box called "slowy shoes box" and the shoes are inside the box. variable defined with var keyword
// defining the variable
var name = "arfy";
// can explicitly with some data types
var other: string = "james";
// cannot using space if using long variable name
var someNumber: int = 30;
var SomeFloating: float = 3.14;
var sOmeStRing: string = "wello";
var soMeboOlean: bool = true;
var somEArray: [int] = [1, 2, 3];
var sOmeData: [string: int] = ["pertama": 1, "kedua": 2];
// write to stdout
print(someNumber);
Data types
data types are categorical value which is describe that value, for example:
- integer value are like
20,1,-90 - float value are like
3.14,-20.2,12.2 - string value are like
"wello","xaviera","jhon","arfy slowy" - boolean value are like
true,false - array value are like
[1, 2, 3],["arfy", "mamads"] - datatable value are like
["key": 12345]
[!NOTE] print will support with or without parentheses (round bracket).