Answer:
def __repr__(self):
s = ''
"
for row in range(self.height):
s += '|'
for column in range(self.width):
s += self.slots[row][column] + '|' + '\n' + (2*self.width +1)*'-' + '\n' + ' '+str(column%10)
return s
Explanation:
The __repr__(self) method in python's object-oriented programming is a magic method used to print an output that represent the object instance of a class.
They have the same vertical resolution. I can suggest you to watch the video in youtube .<span>https://www.youtube.com/watch?v=uluEEGBHyUE</span>
Answer:
Locale unaware
'{:,}'.format(value) # For Python ≥2.7
f'{value:,}' # For Python ≥3.6
Locale aware
import locale
locale.setlocale(locale.LC_ALL, '') # Use '' for auto, or force e.g. to 'en_US.UTF-8'
'{:n}'.format(value) # For Python ≥2.7
f'{value:n}' # For Python ≥3.6
Answer:
2.342m
Explanation:
Given
Time = 0.5 s
Height of Window = 2m
Because the pot was in view for a total of 0.5 seconds, we can assume that it took the cat 0.25 seconds to go from the bottom of the window to the top
Using this equation of motion
S = ut - ½gt²
Where s = 2
u = initial velocity = ?
t = 0.25
g = 9.8
So, we have.
2 = u * 0.25 - ½ * 9.8 * 0.25²
2 = 0.25u - 0.30625
2 + 0.30625 = 0.25u
2.30625 = 0.25u
u = 2.30625/0.25
u = 9.225 m/s ------------ the speed at the bottom of the pot
Using
v² = u² + 2gs to calculate the height above the window
Where v = final velocity = 0
u = 9.225
g = 9.8
S = height above the window
So, we have
0² = 9.225² - 2 * 9.8 * s
0 = 85.100625 - 19.6s
-85.100625 = -19.6s
S = -85.100625/19.6
S = 4.342
If 4.342m is the height above the window and the window is 2m high
Then 4.342 - 2 is the distance above the window
4.342 - 2 = 2.342m