擅长:python、mysql、java
<p>这是正确的:将“=”替换为“=”。因为您正在检查未分配</p>
<pre><code>def user_input_validation(user_input_month , user_input_day):
if (user_input_month < 1 or user_input_month > 12 :
valid_month = False
print ("Invalid month. Please enter a number between 1-12")
else :
valid_month = True
if user_input_day < 1 or user_input_day > 31 :
valid_day = False
print ("Invalid day. Please enter a number between 1-12")
else :
valid_day = True
if valid_month==True and valid_day == True :
return True
</code></pre>