A godot script by itself is already a class, so you should not use
class Class1 or
class Class2 at the start of the file. There are quite a few errors in your code.
The right way to do it would be something like this:
extends Node # Your class can extend from any other node or class, even created ones
# Declaring variables common for the class
# The vars inherited from the class file could be set on `_init` or any other loop like `_process` or `_fixed_process`
name = "frog" # See, I didn't specify "var" since all the
age = 2 # following variables exists in "my_class.gd"
inventory = ["Master Sword","Water"]
print("Hi, I am ", name, ", ", age," years old and I have: ", inventory) # test-print
As you can see, the very first line of code should be extends "path to the file" or a name of a built in class. After that, it is just a matter of changing the vars on the file.