how to convert this code to python

#include<bits/stdc++.h>
using namespace std;
int maxi = INT_MAX;
int maxx(int a, int b)
{ 
    return (a > b)?a:b;
}
void cal_Time(int total, int sum, int i, vector<int> v1)
{  
    if(maxx(sum, total-sum) < maxi) 
    {       
        maxi = maxx(sum, total-sum);    
    } 
    if(v1[i]) 
        return; 
    cal_Time(total, sum + v1[i], i+1, v1); 
    cal_Time(total, sum, i+1, v1); 
    return;
}
int main()
{ 
    int n, i = 1, sum=0;
    string s;   
    vector<int> v1; 
    getline(cin, s, '\n');  
    stringstream ss(s); 
    while(ss>>n)    
    {       
        sum+=n;     
        v1.push_back(n);    
    } 
    cal_Time(sum, 0, 0, v1);    
    cout<<maxi;
}

A good first step would be to tell us what the code is supposed to do. A good second step would be to tell us how familiar you are with Python. And a good third step would be to tell us how much you are willing to pay to have someone do it for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.