Can someone convert this code to python??
//Code in C++: - #include<bits/stdc++.h> using namespace std; // BST node structure class Node { public: int val; int count; Node * left; Node * right; // Constructor Node(int num1, int num2) { this -> val = num1; this -> count = num2; this -> left = this -> right = NULL; } }; int addNode(Node * & root, int value, int countSmaller) { // Base case if (root == NULL) { root = new Node(value, 0); return countSmaller; } if (root -> val < value) { return root -> count + addNode(root -> right, value, countSmaller + 1); } else { root -> count++; return addNode(root -> left, value, countSmaller); } } int simpleMethod(int a[], int n) { int cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (a[j] < a[i]) cnt++; } } return cnt; // Time complexity will be O(n^2);