How do you find the sum of odd numbers in a while loop in python?

I'm new to programming and was asked to sum odd numbers from 1 to [2*n]-1 using a while loop. This is my attempt:

def sum_odd_n[n]:
    while n

Chủ Đề