Variable with keyword name in dictionary?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Maverik
:warning: Old Version Published before Godot 3 was released.

Basically trying to do something like

dictionary {
var 1 = a
var 2 = b
var 3 = c
}

The problem happens when var 1-3 happens to share same word with a keyword like str or tan. Is there way to keep variable name? @“str” does not seem to do it.

:bust_in_silhouette: Reply From: supaiku

Something like this?

var dict = {
    "str": "str keyword",
    "tan": "tan keyword",
    "PI": 3.14
}

Returns : Unexpected assign.
Plus I also have variables in dictionary values.

Maverik | 2016-09-21 10:12

Show your code. It should work.

Also, variables as values is no problem…

var x = 2
var dict = {
    "x": x
}

supaiku | 2016-09-21 10:24

True, pardon me, used = instead of :, it working.

Maverik | 2016-09-21 10:35