I don't know whether to critisize or praise Python Programming Language

Правка en1, от ashwanikumarsharma, 2024-10-26 06:11:04

I was doing a Project Euler Problems, motivated by Radewoosh and aryanc403. I came across a problem that required finding the sum of the digits of a factorial. I still can't figure out how to implement it in C++ (there must be some way), but in Python, even a one-day beginner in coding can write this code easily. On one hand, Python makes our life easy, but on the other hand, it kills coding. There is literally no Integer Overflow. You can even do multiplication of a 100-digit number by another 100-digit number. Now I understand why some people do some specific problems in Python and the rest in C++ during Codeforces contests.

a = 1
for i in range(2, 101):
    a *= i

ans = 0
while a > 0:
    ans += (a % 10)
    a //= 10

print(ans)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ashwanikumarsharma 2024-10-26 06:11:04 889 Initial revision (published)