Tutorial - assigment Flashcards

1
Q

declare it a new local or global variable

A

var x, y: int

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

assigns 3 to the variables x and y

A

var x, y = 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The compiler must be able to … in a constant declaration at compile time

A

It must be able to evaluate the expression in a constant declaration at compile time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between let and const

A

The difference between let and const is: let introduces a variable that can not be re-assigned, const means “enforce compile time evaluation and put it into a data section”

const input = readLine(stdin) # Error: constant expression expected
let input = readLine(stdin)   # works
How well did you know this?
1
Not at all
2
3
4
5
Perfectly