Advertisement
YST

questionBuildedMyOwnPython

YST
Nov 18th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. #question builded 1
  2. my_str3="maryam"
  3. my_str4="meryam"
  4. count=0
  5. for value in my_str3:
  6.     if my_str3[count]==my_str4[count]:
  7.         print("equal")
  8.     else:
  9.         print("unequal")
  10.     count=count+1
  11. #question builded 2
  12. sum=[]
  13. myList1=[1,2,3,4]
  14. myList2=[5,6,7,8]
  15. count2=0
  16. if len(myList1) == len(myList2):
  17.     for value in myList1:
  18.         sum.append(myList1[count2]+myList2[count2])
  19.         count2=count2+1
  20. elif len(myList1) != len(myList2):
  21.     print("unequal lenght of both list")
  22. print(*sum)
  23. #question 3 builded
  24. tempList=[]
  25. ans=input("enter?")
  26. while (ans=='y'):
  27.     username=input("username : ")
  28.     password=input("password : ")
  29.     tempList.append({username:password})
  30.     ans = input("enter?")
  31. print(tempList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement