10 июля 2026
KekCan someone give me a hint how to get x and y intercept on day 3 exercise? With only what was learned till there.
for the x intercept let y be 0 and for the y intercept let x be 0
Damn my math is really rusted I guess.
When it says: Calculate the slope, x-intercept and y-intercept of y = 2x -2
Isn't the slope already on the formula? Isn't the slope the first 2? Y = mx + b?
So m is slope (2) and b is -2?
Because I'm trying to figure out how to calculate he slope with this formula, but slope is already in there no? Or am I stupid?
KekI mean I know how to do the math on paper but how do I make python do it?
It won't do stuff if I go 0 = 2x -2 bc x is not defined obviously. So how do I let python do the math? Or am I misunderstanding the exercise? Should I do the math myself and just put the results as variables?
I think your supposed to make the math alone then just put the results on python at least thats what I did
KekDamn my math is really rusted I guess.
When it says: Calculate the slope, x-intercept and y-intercept of y = 2x -2
Isn't the slope already on the formula? Isn't the slope the first 2? Y = mx + b?
So m is slope (2) and b is -2?
Because I'm trying to figure out how to calculate he slope with thi
Yes the slope is 2 and the y intersect is -2 for the x intersect you would have to calculate that by making y 0
Yea okay, that makes so much more sense to my. I was ramming my head against the wall trying to let python do the math without using anything that has not been shown yet.
Also in day3 exercise 20. Check if int('9.8') is equal to 10.
You can't do that int bc it's not taking '9.8' as a string. Is that correct or did I do smth wrong? I changed it to int(9.8) effectively converting float to int instead of str and it works.
KekYea okay, that makes so much more sense to my. I was ramming my head against the wall trying to let python do the math without using anything that has not been shown yet.
Also in day3 exercise 20. Check if int('9.8') is equal to 10.
You can't do that int bc it's not taking '9.8' as a string. Is t
Yah what u did at last is correct since its a string with decimal ur supposed to convert it to float then to int it can be written like this int(float('9.8))
#1 - 3
user_age = 26
user_height = 1.80
complex_number = 5 + 2j
#4
triangle_base = int(input("Base of Triangle:"))
triangle_height = int(input("Height of Triangle:"))
#5
print("The Area of the triangle is:", triangle_base * triangle_height * 0.5)
triangle_side_a = int(input("Triangle side a:"))
triangle_side_b = int(input("Triangle side b:"))
triangle_side_c = int(input("Triangle side c:"))
triangle_perimeter = triangle_side_a + triangle_side_b + triangle_side_c
#6
print("Triangle Perimeter is:", triangle_perimeter)
rectangle_length = int(input("Rectangle length:"))
rectangle_width = int(input("Rectangle Width:"))
rectangle_area = rectangle_length * rectangle_width
rectangle_perimeter = rectangle_length + rectangle_width * 2
print("Rectangle Perimeter is:", rectangle_perimeter)
print("Rectangle Area is:", rectangle_area)
#7
circle_radius = int(input("Enter Circle radius:"))
circle_area = 3.14 * circle_radius ** 2
circle_circumference = 3.14 * circle_radius * 2
print("Cirlce Area is:", circle_area)
print("Circle Circumference is:", circle_circumference)
#8
slope1 = 2
xintercept1 = 1
yintercept1 = -2
print("Slope1:", slope1)
print("x intercept", xintercept1)
print("y intercept", yintercept1)
x1, y1, x2, y2 = 2, 2, 6, 10
#9
slope2 = (y2 - y1) / (x2 - x1)
euclidean_distance = ((x2 - x1) 2) + ((y2 - y1) 2) * 0.5
print("Slope2:", slope2)
print("Euclidean Distance:", euclidean_distance)
#10
print("Are slope1 and slope2 the same?:", slope1 == slope2)
#11
x = -3
print("Y=", x ** 2 + 6 * x + 9)
#12
print(len("python") != len("dragon"))
#13
print("on" in "python" and "on" in "dragon")
#14
print("jargon" in "I hope this course is not full of jargon")
# 5
print("on" not in "python" and "on" not in "dragon")
#16
python_length = len("python")
python_length_float = float(python_length)
python_length_str = str(python_length_float)
print("Python Length in int, float, string:", python_length, python_length_float, python_length_str)
#17
even_check = int(input(