current position:Home>How should beginners do this problem

How should beginners do this problem

2022-02-04 16:29:26 CSDN Q & A

img




Take the answer :

n=int(input())
r=1;
for i in range(1,n+1,1):
r=r*i
print(r)



Other answers 2:
# -*- coding:utf-8 -*-n = int(input(' Please enter 1  To  10  Number between : '))if n <= 1:    print(' The input is a number less than  1  了 ')elif n >= 10:    print(' The input number is greater than  10  了 ')else:    # res = 1    # for i in range(1,n+1):    # res *= i    # print('{}! = {}'.format(n,res))    from math import factorial    print('{}! = {}'.format(n,factorial(n)))

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/02/202202041629246862.html

Random recommended