-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathb7.py
More file actions
59 lines (39 loc) · 939 Bytes
/
b7.py
File metadata and controls
59 lines (39 loc) · 939 Bytes
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
#sets
# s = "cat"
# print("".join(reversed(s)))
# num = 25
# if num % 5 == 0:
# if num % 2 == 0 :
# print("java")
# else :
# print("python")
# else :
# print("c++")
#sets are unordered , unchangeable , unindexed
#sets are unordered so this means in what order they could appear
# sets are unchangeable but we can add or remove items.
# duplicates are not aloowed in sets
# a = {"apple", "apple"}
# print(a)
# in sets true and 1 are considered as same and duplicates
# a = {True,1}
# print(a)
#in sets flase and 0 are considered as same and duplicates
# a = {False,0}
# print(a)
# we can use set() constructor to construct a set using double brackets
# a = set(("apple"))
# print(a)
# access items using for loop
# a = {"apple" , "banana"}
# for x in a :
# print(x)
# a= "5"
# b = "5"
# print(a+b)
# x = 'hello'
# y = x.upper()
# print(x,y)
# for a in range(len(x)):
# x[a] = x[a].upper()
# print(x)