Created
July 11, 2021 15:18
-
-
Save krypton-byte/a6ecbe70b1830da60b1e65697acd25c1 to your computer and use it in GitHub Desktop.
untuk menghitung deret aritmetika
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def deret_aritmatika(data:dict, suku) ->int: | |
| beda = eval("-".join(data[i].__str__() for i in sorted(data)[::-1]))/eval("-".join(map(str, sorted(data)[::-1]))) | |
| a = data[min(data)]-2*beda | |
| Sn = 0.5*suku*(2*a+(suku-1)*beda) | |
| return Sn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment