Professional Documents
Culture Documents
HOD (COMPUTER):
CLASS : 12th
SECTION : B1
ROLL NO : 19
ACKNOWLEDGEMENT
[KULJEET NISCHAL]
CERTIFICATE
def facto():
n=int(input("Enter the number:"))
f=1
for i in range(1,n+1):
f*=i
print(f, end=" ")
facto()
.j
output:
2. Write a python program to accept the username “Admin”
as the default argument and password 123 entered by the user
to allow login into the system.
def user_pass(password,username="Admin"):
if password=='123':
print("You have logged into system")
else:
print("Password is incorrect!!!!!!")
password=input("Enter the password:")
user_pass(password
output:
3: Program to enter two numbers and print the
arithmetic operations like +,-,*, /, // and %.
Output:
4:Python Program to find Perfect Number using For loop
5:Write a program to check if the entered number is armstrong or not
Output:
6: Recursively find the factorial of a natural number.
Output:
7:Python program to Check if element exists in list in Python
lst=[ 1, 6, 3, 5, 3, 4 ]
=7
if i in lst:
print("exist")
else:
print("not exist")
output:
8.Python program to find smallest number in a list
# list of numbers
list1 = [10, 20, 4, 45, 99]
# list of numbers
list1 = [10, 20, 4, 45, 99]
a
n
y
n
o
"
)
)
b
=
a
*
a
c
=
a
*
a
*
a
p
r
i
n
t
(
"
S
q
a
=
i
n
t
(
i
n
p
u
t
(
"
E
n
t
e
r
a
n
y
n
o
"
)
)
b
=
a
*
a
c
=
a
*
a
*
a
p
r
i
n
t
(
"
S
q
u
a
r
e
"
,
b
)
Program:11