with as structure python code example
Example 1: python data structures
#string
string = 'Hi my name is Dr.Hippo'
#integer(whole number)
integer = 12345
#floating point number
fl = 123.456
#list
li = [1,2,3,,'string',None]
#boolean
t = True
f = False
#none(equivalent to null or undefined in other languages)
n = None
#dictionary
dictionary = {'key':'value'}
Example 2: python c like struct
from typing import NamedTuple
class User(NamedTuple):
name: str
class MyStruct(NamedTuple):
foo: str
bar: int
baz: list
qux: User
my_item = MyStruct('foo', 0, ['baz'], User('peter'))
print(my_item) # MyStruct(foo='foo', bar=0, baz=['baz'], qux=User(name='peter'))