Math in Python is easy + exercises 📐

preview_player
Показать описание
#Python #math #module

Python arithmetic operators and math module tutorial example explained

00:00:00 arithmetic operators
00:04:23 built-in functions
00:06:43 math module
00:08:44 exercise #1 circumference of a circle
00:10:30 exercise #2 area of a circle
00:12:00 exercise #3 hypotenuse calculator
Рекомендации по теме
Комментарии
Автор

How relatable do you want the thumbnail to be?
Bro Code: Yes

Alltopicreader
Автор

3:37 Is an amazing way to explain remainders. Understood it right away.

Curious_Clover
Автор

Adding stupid features to this simple exercises makes them really fun tho.

import math
Title = "Pizza circumference and area calculator"
print(Title.title())
diameter = input("Please enter diameter of your pizza: ")
flavour = input("Enter your pizza's flavour: ")
if flavour == "Hawaii" or "Pineapple":
print("How the fuck can you eat that?")
if bool(diameter.isdigit()) == False:
print("This is not a diameter of your pizza >:(")

if bool(diameter.isdigit()) == True:
diameter = int(diameter)
r = diameter/ 2
C = 2 * math.pi * r
A = math.pi * pow(r, 2)
C = round(C, 1)
A = round(A, 1)
print(f"The circumference of your {flavour} pizza equals: {C} cm.")
print(f"The area of your {flavour} pizza equals {A} cm^2.")
Third Program
import math
Title = "Weird triangle thingy calculator"
print(Title.upper())
side_a = input("Enter first side of a triangle: ")
side_b = input("Enter second side of a triangle: ")
if bool(side_a.isdigit()) == False or bool(side_b.isdigit()) == False:
print("Cant make math out of that.")
print("Both sides have to be numbers")
elif bool(side_a.isdigit()) == True and bool(side_b.isdigit()) == True:
side_c = math.sqrt(pow(int(side_a), 2) + pow(int(side_b), 2))
print(f"The third side of this triangle equals {round(side_c, 2)} cm")

niceballz
Автор

How can you say that you have no friends by now you have gattered at least more than half a million of them

luiseduardo
Автор

If 'Friends = 0;'
So '100 friends' means '0 * 100 = 0'.
So it's still 0 then.

youtube_new_update_sucks
Автор

Bro said it was going to be confusing, but made it the easiest thing I’ve ever seen

Ai-iann
Автор

Wonderful to learn python from your videos. You teach so well in an easy way. Sir can you please give some exercises as a daily lesson for beginners.

qhrftmu
Автор

Absolutely delightful video. Thanks a lot for sharing.

annoyingprecision
Автор

if friends == 0:
if weed == 0:
print('the hell is unavoidable, gg wp')
else:
print('You escaped the hellhole for a while, but it wont last for long')
else:
print('You are dreaming, wake up. This is not happening.')

Rekon-sewv
Автор

We have half of friend😂 good informative vid too

GTV_
Автор

import math

a = float(input("Enter a:"))
b = float(input("Enter b:"))
c = math.sqrt(pow(a, 2) + pow(b, 2))
print(f"c is: {c}")

Enter a:3
Enter b:4
c is: 5.0

abdulhannan-
Автор

import math

Base=float(input("Enter the measurement of base:"))
the measurement of perpendicular:"))
hypotenuse = math.sqrt( pow(Base, 2)+pow(Perpendicular, 2))
print(f"The hypotenuse of the triangle is: {hypotenuse}")

Wisdom_
Автор

I have always believed that education is the ultimate code to crack. Thanks to Bro Code, I have been able to unlock some of the most complex programming languages and computer science concepts with ease. Your videos have been instrumental in helping me level up my skills. So, from the bottom of my heart (and stack), thank you for being the best educational channel out there. Keep up the good work, Bro Code! Your dedication to educating the masses about programming languages and computer science has been truly inspiring. I would love to connect with you and learn more about your journey and how you became one of the best educational channels out there. again, thank you for being a constant source of knowledge and inspiration for us all. You're the real MVP, Most Valuable Programmer

MohyDev
Автор

Thanks bro code I know very little about python and I have a project where I need to make a pizza ordering thing from scratch and this really helped so again thank you

lucky_overdrive
Автор

Ceil (up by 1) vs floor (down by 1):

x = 3.72246
y = 4
z = 5
print(x.__floor__())

3

x = 3.12246
y = 4
z = 5
print(x.__ceil__())

4

abdulhannan-
Автор

hellow bro code we need a video like how they connect front end website to back end using python give a full clarification as well as make a video that would really help for us

techbio
Автор

Ended up in the loophole making myself create a sine and cosine rule calculator lol it was fun

DailyDoseofSpace.
Автор

x = 3.12246
y = 4
print(round(x, 4))

3.1225

abdulhannan-
Автор

Bro how to use trigonometrical equation in python

akashdakrinayak
Автор

Love ❤ you for the exercise and explaining way.
For you 🌷⚘🌹💯

jamilhfl