-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
3434 lines (2044 loc) · 90.2 KB
/
Copy pathmain.py
File metadata and controls
3434 lines (2044 loc) · 90.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# 1. List
# Type: list
# Definition: Ordered, mutable (changeable) collection of items.
# Syntax: my_list = [1, 2, 3, "apple"]
# Usage: Allows duplicates, indexing, slicing, and can store mixed data types.
# Example: my_list[0] gives 1.
# 2. Tuple
# Type: tuple
# Definition: Ordered, immutable (unchangeable) collection of items.
# Syntax: my_tuple = (1, 2, 3, "banana")
# Usage: Used for fixed collections of items, faster than lists.
# Example: my_tuple[1] gives 2.
# 3. Dictionary
# Type: dict
# Definition: Unordered collection of key-value pairs.
# Syntax: my_dict = {"name": "Alice", "age": 25}
# Usage: Access values by keys, no duplicate keys allowed.
# Example: my_dict["name"] gives "Alice".
# 4. Set
# Type: set
# Definition: Unordered collection of unique items.
# Syntax: my_set = {1, 2, 3, "apple"}
# Usage: Fast membership testing, no duplicates.
# Example: {1, 2, 3} | {3, 4, 5} gives {1, 2, 3, 4, 5}.
# 5. String
# Type: str
# Definition: Ordered, immutable sequence of characters.
# Syntax: my_string = "Hello, World!"
# Usage: Text manipulation, indexing, slicing.
# Example: my_string[0] gives "H".
# 6. Integer
# Type: int
# Definition: Represents whole numbers.
# Syntax: my_int = 42
# Usage: Used for counting, arithmetic operations.
# Example: my_int + 8 gives 50.
# 7. Float
# Type: float
# Definition: Represents decimal numbers.
# Syntax: my_float = 3.14
# Usage: Used for precise calculations.
# Example: my_float * 2 gives 6.28.
# 8. Boolean
# Type: bool
# Definition: Represents True or False.
# Syntax: is_active = True
# Usage: Used for conditional statements, logical operations.
# Example: 5 > 3 gives True.
# a = 5
# b = 7
# c= a+b
# # print (c)
# a = input("Give a number: ")
# b = input("Give a number: ")
# sum = int(a) + int(b)
# print("Sum:", sum)
# x = input("Type a number: ")
# y = input("Type another number: ")
# sum = int(x) + int(y)
# print("The sum is: ", sum)
#GLobal Variable
# x = "awesome"
# Y = "Dump"
# def myfunc():
# print("Python is "+Y)
# myfunc()
# x = "awesome"
# def myfunc():
# global x
# x = "fantastic"
# myfunc()
# print("Python is " + x)
#User Input Sum
# a = input("Int:")
# b = input("Float:")
# c = input("Complex:")
# Sum = int(a)+ float(b)+complex(c)
# print("Sum is:", Sum)
"""
print(1)
print(2)
Comments, Escape Sequences & Print Statement
"""
# print("Apple\nOrange")#New Line
# print('Hello, \"WhatsUp?\"') #Escape Sequence
# print("Pi=",3.,1,4,1,6, sep="~", end="Arkisu mone nai\n") # sep= Separator, end = specify what should be end.
# print('Done')
#Variable and Data Type
# a=1
# print(a)
# Ragib=9
# b=Ragib
# print(b)
# a = 1
# b = True
# c = "Ragib"
# d = None
# print("a=",a, "\nb=",b, "\nc=",c, "\nd=",d)
# print("Type of a is:", type(a))
# print("Type of b is:", type(b))
# print("Type of c is:", type(c))
# print("Type of d is:", type(d))
# print("Type of a is",type(a),"type of b is:",type(c))
#4 Build in data Types
# 1. List, **Can be change Mutable,List items are ordered, changeable, and allow duplicate values.List items are indexed, the first item has index [0], the second item has index [1] etc.
# 2. Tuples, ** Not changeable Immutable, Tuple items are ordered, unchangeable, and allow duplicate values.Tuple items are indexed, the first item has index [0], the second item has index [1] etc.
# 3. Sets, **A set is a collection which is unordered, unchangeable*, and unindexed.Set items are unordered, unchangeable, and do not allow duplicate values.
# 4. Dictionaries, **Dictionary items are ordered, changeable, and do not allow duplicates.
# list1=[1,2,3,[-2,-3],["Apple"]]
# print(list1)
# tuple1 = (("Tiger","Lion"),("RAT"))
# print(tuple1)
# set1 = {"apple", "banana", "cherry"}
# print(set1)
# Dict1 = {"Ragib":"WHO","Vote":True}
# print(Dict1)
#Operators
# print(26//5) #Floor division
# print(5%3) #Modulus
# print(2**3) #Exponential
# a=50
# b=50
# print("Addition a+b:",a+b)
# print("Addition a-b:",a-b)
# print("Addition a*b:",a*b)
# print("Addition a/b:",a/b)
# #IF condition
# a = 100
# b = 200
# if a > b:
# print("a is greater than b")
# elif a < b:
# print("b is grater than a")
# elif a == b:
# print("Equal")
# elif a != b:
# print("Not equal")
# else:
# print("error")
#Typecasting (2 types)
# 1. Explicit
# 2. Implicit
# a = "1"
# b = "2"
# print(int(a)+int(b))#Explicit
# a = 1
# b = 4.5
# print(a+b)#Implicit
#User Input:
# a = input("Who is the Don? ")
# print("The don is : Mr.",a)
# x = input("Enter First number:")
# y = input("Enter Second number:")
# print(x+y)
# print(int(x) + int(y))
#String
# name = 'Ragib'
# quotes = '''He said, "Nothing is impossible"'''
# test = 'What "is" up?'
# test2 = "What is \"up\" next?"
# print(quotes)
# print(test)
# print(test2)
# print(name[0])
# print(name[1])
# print("Lets use a for loop\n")
# for character in name:
# print(character)
#Strings Slicing and operations [String are immutable]
# names = "Abrar,Ragib"
# print(names[0:6])
# fruit = "Mangoo"
# mangoLen = len(fruit)
# print(mangoLen)
# print(fruit[0:4])
# print(fruit[1:4])
# print(fruit[:4])
# print(fruit[0:])
# print(fruit[:])
# print(fruit[:])
# nm = "haRry"
# print(nm[-4:-2])
# count= "Bangladesh"
# print(count[4:7]) #Here Bangladesh is [0,1,2,3,4,5,6,7,8,9]
# #4 means l/3 & 7 means 6/d. (x normal,y always -1)
# count= "Bangladesh"
# print(count[-2:])
# a= "!!!Ragib !!!!!! Ragib!!"
# print("Lenth:",len(a))
# print("My String:",a)
# print("In Upper Case:",a.upper())
# print("In Upper Case:",a.lower())
# print("Striped:",a.rstrip("!")) #Only for tail
# print(a.replace("Ragib","Abrar"))
# print(a.split(" "))
# b = "my Blog Heading"
# print(b.capitalize())
# c = "Whats Up?"
# print(len(c))
# print(len(c.center(50)))
# print("Ragib count:",a.count("Ragib"))
# print(c.endswith("?"))#Boolean datatype
# c = "Whats Up?"
# #012345678
# print(c.endswith("Up",6,8))
# d = "What is you name?"## Find index number
# print(d.find("is"))
# print(d.index("iss")) #Through error and programme should be run.
# str1 = "WelcomeToTheConsole1"
# print(str1.isalnum())
# str1 = "Welcome"
# print(str1.isalpha())
# str1 = "hello world"
# print(str1.islower())
# str1 = "We wish you a Merry Christmas!"
# #str1 = " \n"#False given
# print(str1.isprintable())
# str1 = " " #using Spacebar
# print(str1.isspace())
# str2 = " " #using Tab
# print(str2.isspace())
# str1 = "World Health Organization"
# print(str1.istitle())
# str1 = "WORLD HEALTH ORGANIZATION"
# print(str1.isupper())
# str1 = "Python is a Interpreted Language"
# print(str1.startswith("Python"))
# str1 = "Python Is a Interpreted Language"
# print(str1.swapcase())
# str1 = "He's name is Dan. Dan is an honest man."
# print(str1.title())
# If Else Statements
# Conditional operators
# >, <, >=, <=, ==, !=
# a = int(input("Enter your age: "))
# print("Your age is: ",a)
# print(a>18)
# print(a<=18)
# print(a==18)
# print(a!=18)
# if(a>18):
# print("You can drive")
# print("Why this line is printed?")
# else:
# print("Yo can not drive!")
# print("WHy")
# num = int(input("Enter integer valuer of a num: "))
# if (num < 0):
# print("Your number is negative")
# elif (num == 0):
# print("Your number is Zero")
# else:
# print("Your number is positive")
# num = int(input("Enter Your Number: "))
# if (num < 0):
# print("Your number is Negative!")
# elif (num > 0):
# if(num <= 10):
# print("Number is between 1-10")
# elif(num > 10 and num <= 20):
# print("Number is between 10-20")
# else:
# print("Number is grater than 20")
# else:
# print("Number is Zero")
# import time
# timestamp = time.strftime('%H:%M:%S')
# print(timestamp)
# timestamp = time.strftime('%H')
# print(timestamp)
# timestamp = time.strftime('%M')
# print(timestamp)
# timestamp = time.strftime('%S')
# print(timestamp)
# # https://docs.python.org/3/library/time.html#time.strftime
# import time
# # Get the current hour
# current_hour = time.localtime().tm_hour #This retrieves the current hour (0-23) from the system's local time.
# # Determine the appropriate greeting
# if 5 <= current_hour < 12:
# greeting = "Good Morning!"
# elif 12 <= current_hour < 18:
# greeting = "Good Afternoon!"
# else:
# greeting = "Good Evening!"
# Print the greeting
# # print(greeting)
# import time
# current_hour = time.localtime().tm_hour
# if 5 <= current_hour < 12:
# print("Good morning")
# elif 12 <= current_hour < 18:
# print("Good afternoon")
# else:
# print("Good Evening")
# for k in range(1, 5001):
# print(k)
#Match Case Statement/ Switch Case:
# x = int(input("Enter the value of x: "))
# # x is the variable to match
# match x:
# # if x is 0
# case 0:
# print("x is zero")
# # case with if-condition
# case 4:
# print("case is 4")
# case _ if x!=90:
# print(x, "is not 90")
# case _ if x!=80:
# print(x, "is not 80")
# case _:
# print(x)
# x = int(input("Enter the value of X: "))
# match x:
# case 0:
# print("X is Zero")
# case 4:
# print("Case is 4")
# case _ if x!=90:
# print(x,"X is not 90")
# case _ if x!=80:
# print(x,"X is not 80")
# case _:
# print(x)
#For Loops:
# money = ["dollar","pound","real"]
# for i in money:
# print(i)
# if i == "pound":
# break
# fruits = ["apple", "banana", "cherry"]
# for x in fruits:
# if x == "banana":
# continue
# print(x)
# colors = ["Red", "Green", "Blue"]
# for color in colors:
# print(color)
# for char in color:
# print(char)
# for x in range(5):
# print(x+1)
# for x in range(1,5):
# print(x)
# for x in range(1, 10, 5): #Step Range()
# print(x)
#While Loop:
# i = 0
# while(i<=5):
# print(i)
# i = i + 1
# print("Done with the loop")
# i = int(input("Give the value of i: "))
# while(i<=50):
# i = int(input("Give the value of i: "))
# print(i)
# print("Done with while loop")
# count = 5
# while(count >= 0):
# print(count)
# count = count - 1
# else:
# print("Done")
#Emulate do while loop
# do {
# loop body;
# }while(condition);
#Break and Continue:
# for i in range(12):
# if(i == 10):
# break
# print("5 X", i+1,"=", 5 * (i+1))
# print("Stop the loop")
# i = 0
# while True:
# print(i)
# i = i + 1
# if(i%100 == 0):
# break
#Functions:
# def isGreater(a,b):
# if (a>b):
# print("First Number is grater than Second Number")
# else:
# print("Second number is grater or Equal")
# a = 6
# b = 1
# isGreater(a,b)
# def Average(a, b, c):
# print("The average of three number is: ", (a+b+c)/3)
# Average(9,10,11)
# def average(*numbers):
# # print(type(numbers))
# sum = 0
# for i in numbers:
# sum = sum + i
# # print("Average is: ", sum / len(numbers))
# # return 7
# return sum / len(numbers)
# # average(4, 6)
# # average(b=9)
# c = average(5, 6, 7, 1)
# print(c)
#List:
# Lists are ordered collection of data items.
# They store multiple items in a single variable.
# List items are separated by commas and enclosed within square brackets [].
# Lists are changeable meaning we can alter them after creation.
# marks = [3, 5, 6, "Harry", True, 6, 7 , 2, 32, 345, 23]
# print(marks)
# print(type(marks))
# print(marks[0])
# print(marks[1])
# print(marks[2])
# print(marks[3])
# print(marks[4])
# print(marks[5])
# print(marks[-3]) # Negative index
# print(marks[len(marks)-3]) # Positive index
# print(marks[5-3]) # Positive index
# print(marks[2]) # Positive index
# if "6" in marks:
# print("Yes")
# else:
# print("No")
# Same thing applies for strings as well!
# if "Ha" in "Harry":
# print("Yes")
# print(marks[0:7])
# print(marks[1:9])
# print(marks[1:9:3])
# lst = [i*i for i in range(10)]
# print(lst)
# lst = [i*i for i in range(10) if i%2==0]
# print(lst)
#marks = [3, 5, 6, "Ragib", True, 6, 7 , 2, 32, 345, 23]
# print(marks)
# print(type(marks))
# print(marks[0])
# print(marks[1])
# print(marks[2])
# print(marks[3])
# print(marks[4])
# print(marks[-3]) #Negative index
# print(marks[len(marks)-3]) #Positive index
# print(marks[5-3])
# print(marks[2])
# if 7 in marks:
# print("Yes")
# else:
# print("No")
# if "Ragib" in marks:
# print("Yes")
# else:
# print("No")
# if "gib" in "Ragib": #FInd specific strings from string
# print("Yes")
# else:
# print("No")
# print(marks)
# print(marks[:])
# print(marks[1:-1])
# print(marks[1:4])
# print(marks)
# print(marks[1:8])
# print(marks[1:8:2]) #Jump Index: 2 means jump 2 index
#List comprehension
# lst = [i for i in range(5)]
# print(lst)
# lst = [i*i for i in range(5)]
# print(lst)
# lst = [i*i for i in range(5) if i%2 == 0]
# print(lst)
#List Methods:
# l = [1, 2, 3, 4, 5, 6]
# print(l)
# l.append(7)
# print(l)
# l = [4, 5, 3, 2, 1, 5]
# print(l)
#l.sort()
# l.sort(reverse= True)
# l.reverse()
# print(l.index(3))
# print(l.count(5))
# m = l.copy()
# m[0] = 0
# print(l)
# print(m)
# l.insert(1, 899)
# print(l)
# m = [300, 400, 500, 50000]
# l.extend(m) #extend list but l will be change
# print(l)
#Concatenating two list:
# m = [300, 400, 500, 50000]
# k = m + l
# print(k)
#Tuples in Python: Tuples are not Changeable!!!
# tup = (1, 3, 9, 20, "Ragib", True)
# #tup = (1)#Python will be confused if you don not add any comma in tuples!!!
# print(type(tup), tup)
# print(tup[0])
# print("Length is: ",len(tup))
# print(tup[-1])
# if "Ag" in "Ragib":
# print("Yes")
# else:
# print("False")
# tup2 = tup[1:4]
# print(tup2)
# countries = ("USA", "Russia", "France", "Canada")
# countries2 = ("Bangladesh", "Nepal", "Bhutan")
# merge = countries + countries2
# print(merge)
# tuple1 = (0, 1, 2, 3, 2, 31, 1, 3, 2, 3)
# # res = tuple1.count(3)
# # res = tuple1.index(3)
# # res = tuple1.index(311)
# # res = tuple1.index(3, 4, 8)
# res = len(tuple1)
# print('Count of 3 in tuple1 is:', res)
#f-strings
# letter = "My name is {1} and I am from {0}"
# country = "Bangladesh"
# name = "Ragib"
# print(letter.format(country,name))
# print(f"We use f-strings like this: Hey my name is {{name}} and I am from {{country}}")
# price = 49.09999
# txt = f"For only {price:.2f} dollars!"
# print(txt)
# # print(txt.format())
# print(type(f"{2 * 30}"))
#Doc strings in Python and PEP8
# def square(n):
# '''Takes in a number n, returns the square of n''' #Must be written last below square!!!
# print(n**2)
# square(5)
# print(square.__doc__)
# def sum(n):
# '''Takes two int number n, returns sum value of n'''
# print(n+n)
# sum(5)
# print(sum.__doc__)
#PEP 8 >> python>> import this
#The Zen of Python, by Tim Peters
#Recursion in python
# def factorial(n):
# if (n==0 or n==1):
# return 1
# else:
# return n * factorial(n-1)
# print(factorial(4))
# def fibonacci(n):
# fib_sequence = [0, 1]
# while len(fib_sequence) < n:
# fib_sequence.append(fib_sequence[-1] + fib_sequence[-2])
# return fib_sequence
# # Number of terms you want in the Fibonacci series
# num_terms = 10
# # Generate and print the Fibonacci series
# fib_series = fibonacci(num_terms)
# print(fib_series)
# def fibonacci_recursive(n):
# if n <= 0:
# return []
# elif n == 1:
# return [0]
# elif n == 2:
# return [0, 1]
# else:
# fib_seq = fibonacci_recursive(n - 1)
# fib_seq.append(fib_seq[-1] + fib_seq[-2])
# return fib_seq
# # Number of terms you want in the Fibonacci series
# num_terms = 10
# # Generate and print the Fibonacci series
# fib_series = fibonacci_recursive(num_terms)
# print(fib_series)
#Sets in python: duplicate value shows one, no order maintain
# Sets in python more or less work in the same way as sets in mathematics. We can perform operations like union and intersection on the sets just like in mathematics.
# a = {"ragib", 34, 4, 5, 2, True, 4}
# print(a)
# ragib = {}
# print(type(ragib))
# for value in a:
# print(value)
# I. union() and update():
# The union() and update() methods prints all items that are present in the two sets. The union() method returns a new set whereas update() method adds item into the existing set from another set.
# Example:
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities3 = cities.union(cities2)
# print(cities3)
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities.update(cities2)
# print(cities)
# II. intersection and intersection_update():
# The intersection() and intersection_update() methods prints only items that are similar to both the sets. The intersection() method returns a new set whereas intersection_update() method updates into the existing set from another set.
# Example:
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities3 = cities.intersection(cities2)
# print(cities3)
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities.intersection_update(cities2)
# print(cities)
# III. symmetric_difference and symmetric_difference_update():
# The symmetric_difference() and symmetric_difference_update() methods prints only items that are not similar to both the sets. The symmetric_difference() method returns a new set whereas symmetric_difference_update() method updates into the existing set from another set.
# Example:
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities3 = cities.symmetric_difference(cities2)
# print(cities3)
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Tokyo", "Seoul", "Kabul", "Madrid"}
# cities.symmetric_difference_update(cities2)
# print(cities)
# IV. difference() and difference_update():
# The difference() and difference_update() methods prints only items that are only present in the original set and not in both the sets. The difference() method returns a new set whereas difference_update() method updates into the existing set from another set.
# Example:
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Seoul", "Kabul", "Delhi"}
# cities3 = cities.difference(cities2)
# print(cities3)
# cities = {"Tokyo", "Madrid", "Berlin", "Delhi"}
# cities2 = {"Seoul", "Kabul", "Delhi"}
# print(cities.difference(cities2))
# #Dictionaries in Python (In past dic are unordered)
# Dictionaries are ordered collection of data items. They store multiple items in a single variable. Dictionary items are key-value pairs that are separated by commas and enclosed within curly brackets {}.
# dic = {
# "Ragib": "Human being",
# "Spoon": "Object"
# }
# print(dic["Ragib"])