diff --git a/AyushBhandariNITK/Week-1/assignment1.txt b/AyushBhandariNITK/Week-1/assignment1.txt new file mode 100644 index 0000000..7d4e5b3 --- /dev/null +++ b/AyushBhandariNITK/Week-1/assignment1.txt @@ -0,0 +1,95 @@ +1 + +In the first one +First output: + +['1','S','T','E'] + +['1','S','T','E'] + +Reason is that list2=list1 create same object so change in list2 will also create change in list1. + +After that list1=list1+[] will create new object for list1. +So that will change in list2 will not create change in list1. + +Second output: + +['1','S','T','E'] + +['1',2,'T','E'] + +Here for first one reason is same that list2=list1 + +Here, list1=list1+[] will not create new object for list1. +So again change in list2 will affect list1 + + +2 +a=[2,3,4,6,5,7,1,8] +print(a) + +b=0 + +e=0 + +while(b!=len(a)): + + for i in range(b,8): + + if(a[i]