## dictionaries comprehensions

square = {f"Square of {num} is":num**2 for num in range(1, 11)}
for k, v in square.items():
    print(f"{k} : {v}")

string = "AnoopSingh"

word_count = {char: string.count(char) for char in string}
print(word_count)

for k, v in word_count.items():
    print(f"{k} : {v}")


odd_even = {i :("even" if i%2==0 else "odd") for i in range(1, 11)}
for k, v in odd_even.items():\
    print(f"{k} : {v}")

###

##This is sets comprehensions

num = {k**2 for k in range(1, 11)}
print(num)

num = {k**2 for k in range(1, 11)}
print(num)
a9735d4ee9b7ef2a20fddb1ea20bd61fed303da6
<mask token>

<mask token>
for k, v in square.items():
    print(f'{k} : {v}')
<mask token>
print(word_count)
for k, v in word_count.items():
    print(f'{k} : {v}')
<mask token>
for k, v in odd_even.items():
    print(f'{k} : {v}')
<mask token>
print(num)
<mask token>
print(num)

square = {f'Square of {num} is': (num ** 2) for num in range(1, 11)}
for k, v in square.items():
    print(f'{k} : {v}')
string = 'AnoopSingh'
word_count = {char: string.count(char) for char in string}
print(word_count)
for k, v in word_count.items():
    print(f'{k} : {v}')
odd_even = {i: ('even' if i % 2 == 0 else 'odd') for i in range(1, 11)}
for k, v in odd_even.items():
    print(f'{k} : {v}')
num = {(k ** 2) for k in range(1, 11)}
print(num)
num = {(k ** 2) for k in range(1, 11)}
print(num)

## dictionaries comprehensions

square = {f"Square of {num} is":num**2 for num in range(1, 11)}
for k, v in square.items():
    print(f"{k} : {v}")

string = "AnoopSingh"

word_count = {char: string.count(char) for char in string}
print(word_count)

for k, v in word_count.items():
    print(f"{k} : {v}")


odd_even = {i :("even" if i%2==0 else "odd") for i in range(1, 11)}
for k, v in odd_even.items():\
    print(f"{k} : {v}")

###

##This is sets comprehensions

num = {k**2 for k in range(1, 11)}
print(num)

num = {k**2 for k in range(1, 11)}
print(num)