Another solution is to use the is logical operator:
if Peter is String:
print("I'm a string")
elif Peter is int:
print("I'm a integer")
elif Peter is Spatial:
print("I'm a spatial")
elif Peter is Resource:
print("I'm a resource")
and so on.
A good practice is to type your variable, this will avoid type testing and will increase performance of your code:
var Peter:int = 0
The editor will complain if you write further:
Peter = "my best friend"