python class's attribute not in __init__
<p>I want to know why the following codes work?<br></p>

<pre><code>#!/usr/bin/env python3

import sys

class Car():
    def __init__(self):    
        pass

if __name__ == '__main__':
    c = Car()
    c.speed = 3
    c.time = 5
    print(c.speed, c.time)
</code></pre>

<p>I accidentally found that I don't have to init attributes in <strong>init</strong>. I learn from every tutor I have to put assignment in <strong>init</strong> like below.</p>

<pre><code>#!/usr/bin/env python3

import sys

class Car():
    def __init__(self):    
        self.speed = 3
        self.time = 5

if __name__ == '__main__':
    c = Car()
    print(c.speed, c.time)
</code></pre>

<p>If there are some official documents can explain this would be better. </p>