diff --git a/CB.EN.U4CSE16234_lab2_q2.py b/CB.EN.U4CSE16234_lab2_q2.py new file mode 100644 index 0000000000000000000000000000000000000000..8719af326c169b96b05c60acf3a18b5a5e2627ae --- /dev/null +++ b/CB.EN.U4CSE16234_lab2_q2.py @@ -0,0 +1,10 @@ +String str1=input("Enter a string") +dict = {} + for n in str1: + keys = dict.keys() + if n in keys: + dict[n] += 1 + else: + dict[n] = 1 +print(dict) +