Question: I have a data frame with the following properties:

```
    Column   Non-Null Count   Dtype 
---  ------   --------------   ----- 
 0   Date     226611 non-null  object

 1   Time     226611 non-null  object

 2   Code     226611 non-null  object

 3   Message  226611 non-null  object

```

`Date` column has values as format : `2021-11-28 00:00:00` and `Time` column has values as format: `08:15:12.476000`. I am trying to create a `DateTime` column with the following code (basically tried most of the available pandas' methods like to\_datetime, to\_timestampe, etc.):

```
df["DateTime"] = pd.to_datetime(df["Date"]+" "+df["Time"])

```

but I keep getting the following error: `unsupported operand type(s) for +: 'datetime.datetime' and 'str'`. Can someone point out what am I missing here? The expected output would be (restricting milliseconds to 2 digits only):

```
     Date                  Time               DateTime 

 0   2021-11-28 00:00:00   08:15:12.476000    2021-11-28 08:15:12.47

```

Answer: 
This should work.

```
def sum_divisors(n):
    sum_divs = []

    for i in range(1, n):
       if n % i == 0:
           sum_divs.append(i)

    return sum(sum_divs)

print(sum_divisors(0)) # sum of 0 = 0
print(sum_divisors(3)) # Should sum of 1 = 1
print(sum_divisors(36)) # Should sum of 1+2+3+4+6+9+12+18 = 55
print(sum_divisors(102)) # Should be sum of 1+2+3+6+17+34+51 = 114

```
You should start your range ( in line 3 ) from n-1 , and then do it again whilst removing unnecessary code ( as mentioned in above answers ) .

Try this :

```
def sum_divisor(num): # Define your function here
    factors_list = [] # Create an empty list here
    for i in range(1,num): # Start your range from 1 and take it to n (beacuse the range will go on till n-1)
        if num % i == 0: # Check if it's divisible
            factors_list.append(i) # Append , if it's true

    total = sum(factors_list) # Add all the factors given in the list
    print(total) # Print 'em

input = int(input("Enter your data : "))
sum_divisor(input)

```