💥Pythan simple program💥
Pythan script to Chek a number even or odd:-
X=int(input("enter a number"))
If x%2=0;
Print(x, "is even")
Else
Print(x, "is odd")
Expected output:-
Enter a number 3
"is odd"
Enter a number 4
"is even"
Single line function to calculate factorial of a number in python:-
F = lambda n : n*f(n-1) if n>0 else 1
Expected output :- >>> f ( 5 )
120
>>>f ( 4 )
24
X=int(input("enter a number"))
If x%2=0;
Print(x, "is even")
Else
Print(x, "is odd")
Expected output:-
Enter a number 3
"is odd"
Enter a number 4
"is even"
Single line function to calculate factorial of a number in python:-
F = lambda n : n*f(n-1) if n>0 else 1
Expected output :- >>> f ( 5 )
120
>>>f ( 4 )
24
Comments
Post a Comment