import csv
with open("user_info.csv","w") as obj:
fileobj=[Link](obj)
[Link](["user_id","password"])
while(True):
user_id=input("enter_id:")
password=input("enter_password:")
record=[user_id,password]
[Link](record)
x=input("press y/Y to continue and nN to terminate the program\n")
if x in "Nn":
break
elif x in "Yy":
continue
with open("user_info.csv","r")as obj1:
fileobj1=[Link](obj1)
given=input("enter the user_id to be searched\n")
for i in fileobj1:
next(fileobj1)
if i[0]==given:
print(i[1])
break
else:
print("no record matches with given user_id:")
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
myfile=open("[Link]","r")
s=[Link]()
linecount=len(s)
size=0
for i in s:
a=len(i)
size+=a
print("size of the file:",size)
print("no of lines in the file:",linecount)
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
def arm() :
n=int(input("Enter the number:"))
s=n
b=len(str(n))
sum=0
while n!=0 :
r=n%10
sum=sum+(r**b)
n=n//10
if s==sum :
print("The given number",s,"is an armstrong number!!")
else :
print("The given number",s,"is not an armstrong number!!")
arm()
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@