擅长:python、mysql、java
<p>如果你认为<code>years = int(years)</code>是问题,跳过它。那不会有什么害处的。在</p>
<pre><code>then = datetime.strptime(inp, "%Y/%m/%d")
diff = datetime.now() - then
if diff.years/365.25 >= 18:
print('You can vote.')
else:
print('You can\'t vote')
</code></pre>