-
Notifications
You must be signed in to change notification settings - Fork 0
Variables and Lists
Rajesh Gautam edited this page Jun 12, 2026
·
1 revision
Assign a value with var{name, value}\. Reference it later with var{name}.
var{name, "Ritvik"}\
var{score, 95}\
pcType{var{name}}\
pcType{var{score}}\
Variables can hold strings, numbers, or lists. Reassign anytime:
var{x, 0}\
var{x, var{x} + 1}\
Build a variable from other variables:
var{greeting, "Hello, " + var{name} + "!"}\
pcType{var{greeting}}\
var{a, 10}\
var{b, 3}\
var{sum, var{a} + var{b}}\
var{diff, var{a} - var{b}}\
var{product, var{a} * var{b}}\
var{quotient, var{a} / var{b}}\
Create a list with items separated by ;:
var{colors, list{"red"; "green"; "blue"}}\
pcType{var{colors}}\
var{nums, list{1; 2; 3; 4; 5}}\