Math Functions In Python are Easy!🐍

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ก.ย. 2024

ความคิดเห็น • 3

  • @YousefCompSci
    @YousefCompSci  13 วันที่ผ่านมา +2

    import math
    g = 9.81
    a = 1
    b = 12
    c = 123
    # rounding variable or number
    print(round(g))
    # rounding up
    print(math.ceil(g))
    # rounding down
    print(math.floor(g))
    # finding the absolute value
    print(abs(g))
    # power of 2 or more
    print(pow(b, 3))
    # square root of a number
    print(math.sqrt(g))
    # finding the largest of a collection
    print(max(a,b,c))
    # finding the smallest of a collection
    print(min(a,b,c))

  • @RogerRantsly
    @RogerRantsly 12 วันที่ผ่านมา +1

    Thanks, dude. I needed a review on this after not coding for so long.