gopika13 commited on
Commit
9919b28
·
verified ·
1 Parent(s): 9f67512

Upload dataset.json

Browse files
Files changed (1) hide show
  1. dataset.json +406 -0
dataset.json ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "image": "images/Listman11.JPEG",
4
+ "text": "sample_list1 = [int(x) for x in input().split(',')]\nsample_list2 = [int(x) for x in input().split(',')]\nl = []\narr = sample_list1 + sample_list2 # The merged result is stored in arr\n\ns = set(arr) # The set function removes duplicates in arr\nl = list(s)\nl.sort() # The sort method sorts the array in ascending order\nprint(l)\n\n# OR\n\n# After taking input and merging into arr, the following steps can be done.\n\nd = {} # Dictionary\n\nfor ele in arr:\n if ele in d:\n d[ele] += 1\n else:\n d[ele] = 1\n\n# This part uses a dictionary to count the number of occurrences of each number."
5
+ },
6
+ {
7
+ "image": "images/Stringman19.JPEG",
8
+ "text": "def frequency(string):\n string = string.split().strip()\n strlist = []\n \n for i in string:\n strlist.append(i)\n \n freq = []\n dict = {}\n\n for i in strlist:\n for i not in freq:\n freq.append(i)\n c = strlist.count(i)\n key.dict = i\n value.dict = c\n c = 0\n \n print(dict)\n\n__init__ main():\n frequency(input())"
9
+ },
10
+ {
11
+ "image": "images/Stringman17.JPEG",
12
+ "text": "def count_chars(str):\n char_count = {}\n\n for char in str:\n if char in char_count:\n char_count[char] += 1\n else:\n char_count[char] = 1\n\n return char_count\n\nstr = \"Programming is fun\"\nresult = count_chars(str)\nprint(result)"
13
+ },
14
+ {
15
+ "image": "images/Listman14.JPEG",
16
+ "text": "sample_list1 = [3, 1, 4, 1, 5, 9]\nsample_list2 = [2, 6, 5, 3, 5]\n\nsample_list3 = []\n\nfor i in range(0, len(sample_list1)):\n sample_list3[i] = sample_list1[i]"
17
+ },
18
+ {
19
+ "image": "images/closest_value1.JPEG",
20
+ "text": "void closestNumber(array,targetNumber) {\n int minimumDifference = 9999;\n int output = 0;\n\n for (int i = 0; i < array.length; i++) {\n if (array[i] >= 0 && targetNumber < 0) {\n int temp = array[i] * -1;\n int temptarget = targetNumber * -1;\n\n if (temptarget > temp) {\n int diff = temptarget - temp;\n minimumDifference = Math.min(minimumDifference, diff);\n output = array[i];\n } else {\n int diff = temp - temptarget;\n minimumDifference = Math.min(minimumDifference, diff);\n output = array[i];\n }\n } \n else if (array[i] < 0 && targetNumber > 0) {\n int temp = array[i] * -1;\n\n if (targetNumber > temp) {\n int diff = targetNumber - temp;\n minimumDifference = Math.min(minimumDifference, diff);\n output = array[i];\n } else {\n int diff = temp - targetNumber;\n minimumDifference = Math.min(minimumDifference, diff);\n output = array[i];\n }\n }"
21
+ },
22
+ {
23
+ "image": "images/Closest_value5.jpg",
24
+ "text": "n = int(input(\"Enter the numbers in sorted order: \")\nt = int(input(\"Enter the target number: \"))\n\nfor i in n:\n if i <= t:\n print(\"numbers close to target value:\", i)\n \n\nn = input(\"Enter the text: \")\nprint(n)\n\nfor i in n:\n s = i + 1+1\n print s"
25
+ },
26
+ {
27
+ "image": "images/Consecutive11.JPEG",
28
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n int i, j, n, ar[30], c[10];\n\n printf(\"Enter the no. of elements\");\n scanf(\"%d\", &n);\n\n printf(\"Enter the elements\");\n for(i = 0; i <= n; i++)\n scanf(\"%d\", &ar[i]);\n for(k=0; k<=10; k++)\n\t for(j = 0; j <= n; j++)\n\t {\n\t\tif(ar[j] == ar[j + 1])\n\t\t{\n\t\t count++;\n\t\t}\n\t\telse\n\t\t break;\n\n\t\tc[k] = count;\n\t }\n\n printf(max [c[k]]);\n}"
29
+ },
30
+ {
31
+ "image": "images/Consecutive8.JPEG",
32
+ "text": "#include <stdio.h>\n#include <stdlib.h>\n\nvoid max_one(int arr, int length) {\n int count = 0, max = 0;\n\n for (int i = 0; i <= length; i++) {\n if (arr[i] == 1) \n count++; // count no. of consecutive 1's.\n else \n count = 0; // reset when 0 comes.\n\n if (count > max) { \n max = count; // store max value.\n }\n }\n printf(\"%d\", max);\n}\n\nvoid main() {\n int arr[50], len;\n\n printf(\"Enter the length of array: \");\n scanf(\"%d\", &len);\n\n printf(\"Enter the array: \");\n for (int i = 0; i < len; i++) { // input\n scanf(\"%d\", &arr[i]);\n }\n\n max_one(arr, len);\n}"
33
+ },
34
+ {
35
+ "image": "images/Closest_value3.jpg",
36
+ "text": "function Find(arrays,target):\n rduplicate = set(arrays)\n difference = abs(target - rduplicate[0])\n\n for i in range(1, len(rduplicate)):\n d = abs(target - rduplicate[i])\n if d < difference:\n difference = d\n pos = i\n\n print(rduplicate[i])\n\nfind([2, 5, 6, 7, 8, 8, 9], 5)"
37
+ },
38
+ {
39
+ "image": "images/Print100_9.JPEG",
40
+ "text": "# Using loop\nn = int(input(\"Enter a limit: \"))\n\nfor i in range(1: n + 1):\n print(i)\n\n# Without using loop\nn = int(input(\"Enter a limit: \"))"
41
+ },
42
+ {
43
+ "image": "images/Closest_value8.JPEG",
44
+ "text": "#include <stdio.h>\n\nint main()\n{\n int a[100], i, k, n, b[100], x = 0;\n\n scanf(\"%d\", &k);\n\n scanf(\"%d\", &n);\n\n for (i = 0; i < n; i++)\n {\n scanf(\"%d\", &a[i]);\n }\n\n for (i = 0; i < n; i++)\n {\n b[i] = k - a[i];\n }\n\n for (i = 0; i < n; i++)\n {\n if (b[i] > b[i+1])\n {\n x = b[i+1];\n }\n else if (b[i] == b[i+1])\n {\n x = b[i+1];\n }\n else if (b[i] < b[i+1])\n {\n x = b[i];\n b[i+1] = b[i];\n }\n }\n\n printf(\"%d\", x);\n\n \n}"
45
+ },
46
+ {
47
+ "image": "images/Stringman6.jpg",
48
+ "text": "#include <stdio.h>\n#include <string.h>\n\nvoid countCharacters(const char* str, int* countDict) {\n while (*str) \n {\n countDict[*str]++;\n str++;\n }\n}\n\nint main() {\n char* inputString;\n \n scanf(\"%s\", inputString);\n\n int countDict[128] = {0};\n \n countCharacters(inputString, countDict);\n\n for (int i = 0; i < 128; i++) {\n if (countDict[i] > 0) {\n printf(\"%c : %d\\n\", i, countDict[i]);\n }\n }\n \n return 0;\n}"
49
+ },
50
+ {
51
+ "image": "images/Consecutive3.JPEG",
52
+ "text": "arr = [int(x) for x in input().split()]\nmax = 0;\ni = 0;\nli_max = []\n\ndo{\n if (arr[i] == 1)\n {\n if (max == 0):\n max += 1;\n i++;\n\t\tif (arr[i] == 1 and arr[i + 1] == 1):\n\t\t max += 1;\n\t\t i++;\n\t\telse if (arr[i] == 1 and arr[i + 1] != 1):\n\t\t li_max.append(max)\n if(max>=1 and arr[i+1]==1)\n max+=1\n i++\n else(max>=1 and arr[i+1]!=1)\n max += 1\n i++\n li_max.append(max)\n }\n else{\n i++;\n }\n}while(i<arr.length())\nprint(max(li_max)"
53
+ },
54
+ {
55
+ "image": "images/Consecutive5.JPEG",
56
+ "text": "count = 0\nn = int(input(\"Enter the size: \"))\nlist = []\n\nprint(\"Enter the elements:\") # Enter 0's and 1's\nfor i in range(0, n):\n num = int(input())\n list.append(num)\n\nfor i in range(0, n):\n if (list[i] == 1 and list[i+1] == 1:\n count = count + 1\n else:\n \tif(list[i] == 0 and list[i+1]==0):\n count = 0\n\nprint(\"Max number of consecutive 1's is\", count+1)"
57
+ },
58
+ {
59
+ "image": "images/Listman16.JPEG",
60
+ "text": "Function array_manipulation(L1, L2):\n L3 = []\n L3 = L1 + L2\n result = []\n\n for ele in L3:\n if ele not in result:\n result.append(L3)\n else:\n continue\n return result.sort()"
61
+ },
62
+ {
63
+ "image": "images/Closest_value4.jpg",
64
+ "text": "def closest_number():\n int arr = [ ] \n int num\n arr.sort() \n\n target_number = i \n\n for i in range(arr):\n if i = target_number:\n print(i)\n else \n i != target_number\n\n print(\"Closest value:\", closest)"
65
+ },
66
+ {
67
+ "image": "images/Listman1.JPEG",
68
+ "text": "#include <stdio.h>\n#include <iostream.h>\n\nint main()\n{\n int list1[20], list2[20], n1, n2, k = 0, min = 1000,res[20],flag=0,Q=0;\n \n printf(\"Enter the number of elements in list1 and list2: \");\n scanf(\"%d %d\", &n1, &n2);\n \n for (int i = 0; i < n1; i++)\n {\n scanf(\"%d\", &list1[i]);\n }\n\n for (int i = 0; i < n2; i++)\n {\n scanf(\"%d\", &list2[i]);\n }\n\n for (int i = n1-1; i < n1 + n2-1; i++)\n {\n list1[i] = list2[k];\n k++;\n }\n\n for (int i = 0; i < n1 + n2; i++)\n {\n for (int j = 0; j < n1 + n2; j++)\n {\n if (min > list1[j])\n {\n min = list1[j];\n }\n }\n list1[j-1] = 111222333;"
69
+ },
70
+ {
71
+ "image": "images/Stringman26.JPEG",
72
+ "text": "s = input(\"Enter a string\")\nn = str(s).count\ndict = {}\nl = []\nfor i in range[int1]:\n if (s[i] in dict{}):\n l[i] = l[i] + 1\n dict.append(s[i]:l[i])\n else:\n l[i] = 1\n dict.append(s[i]:l[i])\n\nprint(dict)"
73
+ },
74
+ {
75
+ "image": "images/Consecutive4.JPEG",
76
+ "text": "num = input() # Reading input\n\ncount = 0\ncount_list = [] # To store count\n\nfor i in range(len(num)):\n if (num[i] == 1):\n {\n count += 1\n if (num[i + 1] == 0)\n {\n count_list.append(count)\n count = 0\n }\n }\n\nprint(\"Max number of consecutive 1's is:\", max(count_list))"
77
+ },
78
+ {
79
+ "image": "images/Consecutive13.JPEG",
80
+ "text": "arr = [int(x) for x in input()] # Take array as input\nflag = 0\n\nfor ele in arr:\n if ele != 0 and ele != 1:\n flag = 1\n break\n\nif flag == 1:\n print(\"Enter correct input\")\n \ncnt = 0\nm = 0\nmax = 0\n\nfor i in range(0, len(arr)):\n if arr[i] == 1:\n cnt = 1\n for j in range(i, len(arr)):\n if arr[j] != 0:\n m = m + 1\n \tm = m + cnt\n if m > max:\n max = m # For each set of consecutive 1s, the maximum value is found here\n\nprint(\"The maximum no. of consecutive 1's is:\", max)"
81
+ },
82
+ {
83
+ "image": "images/Stringman11.JPEG",
84
+ "text": "tr = input().lower()\nd = { }\n\nfor ele in str:\n if ele not in d:\n d[ele] = 1\n else:\n d[ele] += 1\n\nprint(\"dictionary =\", end=\" \")\nprint(d.items())"
85
+ },
86
+ {
87
+ "image": "images/Consecutive9.JPEG",
88
+ "text": "list1 = []\n\nnum = int(input(\"Enter the number\")) \ncount = 0 \n\nn = len(num) \n\nfor i in range(0, n-1): \n if num[i] == 1: \n list1[i] = count++\n else: \n break \n\nprint(max(list1))"
89
+ },
90
+ {
91
+ "image": "images/Print100_5.jpg",
92
+ "text": "// Without loop\nSystem.out.println(\"1\");\nSystem.out.println(i.next);\nSystem.out.println(i.next+1);\n...\n?"
93
+ },
94
+ {
95
+ "image": "images/Closest_value6.JPEG",
96
+ "text": "int A[10], i, n, k;\n\nprintf(\"Target number: \");\nscanf(\"%d\", &k);\n\nfor (i = 0; i < n; i++)\n{\n if (A[i] = k)\n printf(\"Output %d\", A[i]);\n else if (A[i] != k)\n printf(\"Output %d\", A[i] > k);\n else\n printf(\"Output %d\", A[n]);\n}"
97
+ },
98
+ {
99
+ "image": "images/Stringman7.jpg",
100
+ "text": "// Python\n\ndef frequ(string s):\n i = 0\n freq = { }\n while i < len(s):\n C = tolower(s[i])\n freq[C]++\n \n return freq\n\n// C++\n\nunordered_map frequency (String s) {\n\n\tunordered_map<char, int> mp ;\n\n\tint i = 0 , n = s.length() ;\n\n\tfor (i = 0 ; i < n ; i++) {\n\n\t Char c = tolower (s(i))\n\t mp[c]++ ;\n\n\treturn mp ;\n}"
101
+ },
102
+ {
103
+ "image": "images/Print100_12.JPEG",
104
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n n = 1;\n \n if (n <= 100)\n {\n printf(\"%d\\t\", n);\n n = n + 1;\n }\n}"
105
+ },
106
+ {
107
+ "image": "images/Listman4.JPEG",
108
+ "text": "def mergeList(list_1, list_2):\n list_3 = list_1 + list_2 # Merging lists\n\n for i in list_3:\n if (count(i) > 1):\n {\n list_3.remove(i) # Removing duplicate values\n\t}\n list_3.sort()\n\n return (list_3) # Return the results in ascending order"
109
+ },
110
+ {
111
+ "image": "images/Print100_3.JPEG",
112
+ "text": "import java.util.Scanner;\n\npublic class Numbers {\n public static void Numbers(int s, int e) {\n if (s <= e) {\n System.out.println(s);\n Numbers(s + 1, e);\n }\n }\n\n public static void main(String[] args) {\n Numbers(1, 100);\n }\n}"
113
+ },
114
+ {
115
+ "image": "images/Consecutive19.JPEG",
116
+ "text": "count = 0\nn = int(input(\"Enter the size: \")) \nlist = [] \n\nprint(\"Enter the elements:\") # Enter 0's and 1's\nfor i in range(0, n): \n num = int(input()) \n list.append(num) \n\nfor i in range(0, n): \n if (list[i] == 1 and list[i + 1] == 1): \n count = count + 1 \n else: \n if list1[i] == 0 and list1[i + 1] == 0: \n count = 0 \n\nprint(\"Max number of consecutive 1's is\", count + 1)"
117
+ },
118
+ {
119
+ "image": "images/Print100_13.JPEG",
120
+ "text": "def add1(s):\n if(s < 101):\n print(s)\n s = s + 1\n add1(s)\n\n__init__main():\n add1(1)"
121
+ },
122
+ {
123
+ "image": "images/Print100_14.JPEG",
124
+ "text": "#include <stdio.h>\n\nvoid number(int n) {\n if (n != 100) {\n printf(\"%d \", n);\n }\n\n if (n <= 100) {\n printf(\"%d \", n);\n n++;\n number(n);\n }\n}\n\nint main() {\n int n = 1;\n number(n);\n return 0;\n}"
125
+ },
126
+ {
127
+ "image": "images/Closest_value.JPEG",
128
+ "text": "#include <stdio.h>\n\nint main() \n{\n int a[100], n, tar, j, sum, temp, b[100];\n\n printf(\"Enter the size of array: \");\n scanf(\"%d\", &n);\n\n printf(\"Enter the array: \");\n for (int i = 0; i < n; i++) \n {\n scanf(\"%d\", &a[i]);\n }\n\n printf(\"Enter the target number: \");\n scanf(\"%d\", &tar);\n\n temp = tar;\n for (j = 0; j < n; j++) \n {\n b[j] = tar - a[j];\n\n if (tar == a[j]) \n {\n printf(\"%d\", tar);\n break;\n }\n }\n\n \n}"
129
+ },
130
+ {
131
+ "image": "images/Stringman25.JPEG",
132
+ "text": "def count_chars(str):\n char_count = {}\n\n for char in str:\n if char in char_count:\n char_count[char] += 1\n else:\n char_count[char] = 1\n\n return char_count\n\nstr = \"Programming is fun\"\nresult = count_chars(str)\nprint(result)"
133
+ },
134
+ {
135
+ "image": "images/Stringman20.JPEG",
136
+ "text": "int count(char ch) // Consider size of s = 5\n{\n for (int i = 0; i < strlen(ch); i++)\n {\n if (strcmp(ch[0], ch[i+1]) == 0)\n c++;\n\n if (strcmp(ch[1], ch[i+1]) == 0)\n d++;\n\n if (strcmp(ch[2], ch[i+1]) == 0)\n e++;\n\n if (strcmp(ch[3], ch[i+1]) == 0)\n f++;\n\n if (strcmp(ch[4], ch[i+1]) == 0)\n g++;\n }\n\n return \n {\n ch[0] = c;\n ch[1] = d;\n ch[2] = e;\n ch[3] = f;\n ch[4] = g;\n };"
137
+ },
138
+ {
139
+ "image": "images/Stringman1.JPEG",
140
+ "text": "def StringCount(s):\n dictionary = {}\n\n for ch in s:\n if s[ch] = s[ch+1]:\n c = c + 1\n \n dictionary.append(ch, c)\n\n print(dictionary)\n\na = StringCount(\"Programming is fun\")\nprint(a)"
141
+ },
142
+ {
143
+ "image": "images/Stringman4.JPEG",
144
+ "text": "def count(s):\n count = 0\n leng = s.length\n arr = [],\n\n for (i=0; i<leng; i++)\n {\n if s.charAt(i) == s.charAt(i+1))\n arr[0]\n s.charAt(i).push()\n count ++;\n }\n else.\n arr[i]=s.charAt(i).push()\n count ++;\n\n dictionary = {arr[i]: count]"
145
+ },
146
+ {
147
+ "image": "images/Consecutive16.JPEG",
148
+ "text": "list1 = []\nnum = int(input(\"Enter the numbers \"))\ncount = 0\n\nn = len(num)\n\nfor i in range(0, n-1):\n if (num[i] == 1):\n list1[i] = count++\n else:\n break\n\nprint(max(list1))"
149
+ },
150
+ {
151
+ "image": "images/Stringman16.JPEG",
152
+ "text": "s = (input(\"Enter a string\"))\nn = str(s).count\ndict = {}\nl = []\n\nfor i in range[:n+1]:\n if (s[i] in dict{}):\n l[i] = l[i] + 1\n dict.append(s[i]:l[i])\n else:\n l[i] = 1\n \tdict.append({s[i]:l[i]})\n\nprint(dict)"
153
+ },
154
+ {
155
+ "image": "images/Listman9.JPEG",
156
+ "text": "#include <stdio.h>\nvoid merge()\n{\n s1 = [3,1,4,5,9]\n\n s2 = [2,6,5,3,5]\n\n s3 = append[s1, s2];\n\n print(s3);\n}"
157
+ },
158
+ {
159
+ "image": "images/Consecutive12.JPEG",
160
+ "text": "arr = [0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0]\ncount = 0\nn = len.arr\n\nfor i in range(0, n):\n if arr[i] == 1:\n count = count + 1\n\nprint(\"Max number of consecutive 1's is:\")\nprint(count)"
161
+ },
162
+ {
163
+ "image": "images/Stringman23.JPEG",
164
+ "text": "def frequency(string):\n string = string.split().strip()\n strlist = []\n \n for i in string:\n strlist.append(i)\n\n freq = []\n dict = {}\n\n for i in strlist:\n for i not in freq:\n freq.append(i)\n c = strlist.count(i)\n key.dict = i\n value.dict = c\n c = 0\n\n print(dict)\n\n__init__main():\n frequency(input())"
165
+ },
166
+ {
167
+ "image": "images/Consecutive14.JPEG",
168
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n int i, j, n, ar[20], c[10];\n\n printf(\"Enter the no. of elements: \");\n scanf(\"%d\", &n);\n\n printf(\"Enter the elements:\\n\");\n for (i = 0; i < n; i++)\n scanf(\"%d\", &ar[i]);\n for(k=0;k<=10;k++)\n\t for (j = 0; j < n; j++)\n\t {\n\n\t\t if (ar[j] == ar[j + 1])\n\t\t\tcount++;\n\t\t else\n\t\t\tbreak;\n\t\t\t\n\t\t\tc[k] = count;\n\t }\n\n printf(max[c[k]]); \n}"
169
+ },
170
+ {
171
+ "image": "images/Consecutive10.JPEG",
172
+ "text": "#include <stdio.h>\n#include <conio.h>\n#include <stdlib.h>\n\nint main()\n{\n int a[], n, i, j;\n\n printf(\"Enter the array size:\");\n scanf(\"%d\", &n);\n\n for(i = 0; i < n; i++)\n {\n printf(\"Enter the required array element:\");\n scanf(\"%d\", &a[i]);\n }\n\n while(i = 0, a[i], i++)\n {\n j = 0;\n if a[i] == 1\n {\n j += 1;\n }\n }\n\n printf(\"Enter the number of consecutive 1's: \");\n scanf(\"%d\", &j);\n\n return 0;"
173
+ },
174
+ {
175
+ "image": "images/Print100_2.JPEG",
176
+ "text": "#include <stdio.h>\n\nint main() {\n int n = 100 , i=1;\n if (i <= n)\n {\n printf( i);\n i = i+1;\n }\n return 100;\n}"
177
+ },
178
+ {
179
+ "image": "images/Stringman13.JPEG",
180
+ "text": "dict = {}\n\ncount = 0\nn = len(s)\n\nfor i in range(0, n+1, 1):\n for j in range(0, i+1, 1):\n if (s[i] == s[j]):\n count ++\n dict.append(s[i]: count)\n\n else:\n count = 1\n dict.append(s[i]: count)\n\nprint(dict)"
181
+ },
182
+ {
183
+ "image": "images/Stringman2.JPEG",
184
+ "text": "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nvoid main() {\n char str, char dict\n int n,str[20]\n\n scanf(\"%s\", &str[i]);\n\n for (i = 0; i < n; i++) {\n if (strcmp(str[i] == 0) \n set str[i] = 1;\n printf(\"%s = %d\", s, str[i]);\n \n else(strcmp(str[i] != 0) && str[i]==1): \n {\n \t printf(\"%s\", = \"%d\", str, str[i]);\n \n return 0;\n}"
185
+ },
186
+ {
187
+ "image": "images/Closest_value2.JPEG",
188
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n int arr[10];\n int i, n, t, diff;\n\n printf(\"Enter the size of array:\\n\");\n scanf(\"%d\", &n);\n\n printf(\"Enter the sorted array:\\n\");\n for (i = 0; i < n; i++)\n {\n scanf(\"%d\", &a[i]);\n }\n\n printf(\"Enter target number:\\n\");\n scanf(\"%d\", &t);\n\n \n\n for (i = 0; i < n; i++)\n {\n diff[i] = t - a[i];\n }\n\n for (i = 0; i < n; i++)\n {\n for (j = 0; j < n; j++)\n {\n if (diff[j] > diff[j+1])\n {\n temp = diff[j];\n diff[j] = diff[j+1];\n diff[j+1] = temp;\n }\n }\n\tif((diff[i]+a[i])==t)\n\t\tprint(\"%d\",a[i]);\n }"
189
+ },
190
+ {
191
+ "image": "images/Stringman22.JPEG",
192
+ "text": "void occurrence(String s):\n dict = {}\n word = s.split()\n\n for i in word:\n dict[i] = count(i)\n\n return dict"
193
+ },
194
+ {
195
+ "image": "images/File_han3.JPEG",
196
+ "text": "#include <stdio.h>\n#include <stdlib.h>\n\nint sum(FILE fp)\n{\n int s = 0, i;\n\n while (getc(fp) != EOF)\n {\n i = gets(fp);\n s = s + i;\n }\n return s;\n}\n\nint main()\n{\n FILE *fp;\n fp = fopen(\"input.txt\", \"r\");\n a = sum(fp);\n printf(\"%d\", a);\n fclose(fp);\n}"
197
+ },
198
+ {
199
+ "image": "images/Print100_10.JPEG",
200
+ "text": "#include <stdio.h>\n\nvoid number(int n) {\n\n \n if (n <= 100) {\n printf(\"%d \", n);\n n++;\n number(n);\n }\n}\n\nint main() {\n int n = 1;\n number(n);\n return 0;\n}"
201
+ },
202
+ {
203
+ "image": "images/Closest10.JPEG",
204
+ "text": "def prgm(array[], target):\n list = []\n\n for i in array:\n list.append(array[i]) \n\n list = list.set()\n\n for i in range(len(list)):\n\n if list[i] == target:\n return target\n\n elif list[i] > target:\n return list[i]\n\n else:\n for i in range(len(list)):\n minimum = min(target - list[i], target - list[i + 1])\n\n for i in range(len(list)):\n if (target - list[i] == minimum):\n return list[i]"
205
+ },
206
+ {
207
+ "image": "images/Stringman9.JPEG",
208
+ "text": "function string_read(input):\n\n list[] = input.\n\n for i in range list.\n\n if list[i] == list[i+1].:\n\n count++"
209
+ },
210
+ {
211
+ "image": "images/Consecutive2.JPEG",
212
+ "text": "print(\"Enter no of elements\")\nn = int(input())\na = []\n\nfor i in range(n):\n num = int(input)\n a.append(num)\n\nl = len(a)\nc = 0\nmax = 0\n\nfor i in range(l):\n if a[i] == 1:\n c = c + 1\n if c > max:\n max = c\n if a[i] == 0:\n c = 0\n\nprint(\"Maximum no of consecutive 1's is:\", max)"
213
+ },
214
+ {
215
+ "image": "images/Closest12.JPEG",
216
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n int a[100], n, target, temp1, temp2, index;\n\n scanf(\"%d\", &n); // Read the number of elements\n\n for (int i = 0; i < n; i++) // Initialize the array\n scanf(\"%d\", &a[i]);\n\n scanf(\"%d\", &target); // Read the target value\n temp2 = __INT_MAX(); // Set temp2 to the highest integer value for comparison\n\n for (int i = 0; i < n; i++)\n {\n temp1 = a[i] - target;\n\n if (temp1 < 0) // Convert the difference to a positive number\n temp1 = temp1* -1;\n\n if (temp1 < temp2) // Store the least difference found\n {\n temp2 = temp1;\n index = i; // Store the index of the closest element\n }\n }\n\n printf(\"%d\", a[index]); // Print the closest element\n}"
217
+ },
218
+ {
219
+ "image": "images/Consecutive18.JPEG",
220
+ "text": "L1 = input()\nlist1 = list(L1)\n\ncount = 0\nonecount = []\n\nfor ele in list1:\n if ele == 1:\n count += 1\n else:\n if count > 0:\n onecount.append(count)\n count = 0\n\nmax_count = max(onecount)\nprint(max_count)"
221
+ },
222
+ {
223
+ "image": "images/Closest_value7.JPEG",
224
+ "text": "def prgm, (array[], target):\n List = []\n\n for i in array:\n List.append(array[i]) \n\n List1 = List.set()\n\n for i in range(len(List)):\n if list[i] == target:\n return target\n elif list1[i] > target:\n return list1[i]\n\telse:\n\t for i in range(len(list)):\n\t\tminimum = min(target - list[i], target - list[i+1])\n\n\t for i in range(len(list)):\n\t\tif (target - list[i]) == minimum:\n\t\t return list[i]"
225
+ },
226
+ {
227
+ "image": "images/Print100_4.JPEG",
228
+ "text": "// Recursive Function\nvoid num(int n) {\n if (n <= 100) {\n printf(\" %d \", n);\n num(n + 1);\n } \n else {\n exit(0);\n }\n}"
229
+ },
230
+ {
231
+ "image": "images/Closest13.JPEG",
232
+ "text": "#include <stdio.h>\n\nint main() {\n int a[100], i, k, n, b[100], x = 0;\n\n printf(\"Enter k: \");\n scanf(\"%d\", &k);\n\n printf(\"Enter n: \");\n scanf(\"%d\", &n);\n\n for (i = 0; i < n; i++) {\n scanf(\"%d\", &a[i]);\n }\n\n for (i = 0; i < n; i++) {\n b[i] = k - a[i];\n }\n\n for (i = 0; i < n; i++) {\n if (b[i] > b[i + 1]) {\n x = b[i];\n } else if (b[i] == b[i + 1]) {\n x = b[i];\n } else if (b[i] < b[i + 1]) {\n x = b[i + 1];\n }\n }\n\n printf(\"%d\", x);\n\n return 0;\n}"
233
+ },
234
+ {
235
+ "image": "images/Print100_11.JPEG",
236
+ "text": "def add1(s):\n if (s < 101):\n print(s)\n s = s + 1\n add1(s)\n\n__init__main:\n add1(1)"
237
+ },
238
+ {
239
+ "image": "images/Listman8.JPEG",
240
+ "text": "def listanclug(a)\n\nsample_list1 = int(input(a))\n\nsample_list2 = int(input(b))\n\nsample_list3 = [ ]\n\nsample_list3 = append(sample_list1(sample_list2))"
241
+ },
242
+ {
243
+ "image": "images/Stringman3.JPEG",
244
+ "text": "int i, j, temp, count = 0;\nchar input[100];\n\nlen = strlen(input[10])\nn = input[0];\n\nfor (i = n; i < len; i++) {\n for (j = i + 1; j < len-1; j++) {\n if input[i] == input[j]\n {\n count++;\n }\n printf(\" \": \" \", input[i], count);\n }\n}"
245
+ },
246
+ {
247
+ "image": "images/Listman3.JPEG",
248
+ "text": "sample_list1 = [int(x) for x in input().split()]\nsample_list2 = [int(x) for x in input().split()]\n\nfinal_list = []\nres = []\n\nfinal_list = sample_list1.merge(sample_list2)\n\nres = sort(final_list)\n\nprint(res)"
249
+ },
250
+ {
251
+ "image": "images/Stringman18.JPEG",
252
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n char s[20];\n int count = 0;\n char a;\n\n printf(\"Enter the string \");\n for (int i = 0; i != '\\0'; i++)\n {\n scanf(\"%s\", &s[i]);\n }\n\n for (int i = 0; i != '\\0'; i++)\n {\n a = s[i];\n for (int j = 0; j != '\\0'; j++)\n {\n if (s[i] != s[j])\n {\n count = 1;\n }\n \n\n\t else if (s[i] == s[j])\n\t {\n\t\tcount++;\n\t }\n\t}\n \tprintf(\"%c %d\", a, count);\n }\n}"
253
+ },
254
+ {
255
+ "image": "images/Listman5.JPEG",
256
+ "text": "list1 = [3,1,4,1,5,9]\nlist2 = [2,6,5,3,5]\n\ndef merge(list1, list2):\n list3 = []\n for i in list1:\n if i not in list3:\n list3.append[i]\n\n for j in list2:\n if j not in list3:\n list3.append[j]\n return list3\n\nprint(\"Merged list in ascending order\")\n\nprint(list3.sort())"
257
+ },
258
+ {
259
+ "image": "images/File_han2.jpg",
260
+ "text": "def prgm2():\n File = input.txt.open(\"r\")\n\n list = File.read()\n sum = 0\n for i in list:\n sum = sum + i\n\n return sum"
261
+ },
262
+ {
263
+ "image": "images/Consecutive15.JPEG",
264
+ "text": "#include <stdio.h>\n#include <conio.h>\n#include <stdlib.h>\n\nint main()\n{\n int a[], n, i, j;\n\n printf(\"Enter the array size: \");\n scanf(\"%d\", &n);\n\n for (i = 0; i < n; i++)\n {\n printf(\"Enter the required array elements: \");\n scanf(\"%d\", &a[]);\n }\n\n j = 0;\n if (a[i] == 1)\n {\n\tj =+ 1;\n }\n\n printf(\"Enter the number of consecutive 1's\");\n scanf(\"%d\",&j)\n\n return 0;\n}"
265
+ },
266
+ {
267
+ "image": "images/File_han4.JPEG",
268
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n FILE *fp;\n fp = fopen(\"input.txt\", \"r\");\n\n char str;\n int sum;\n\n while (str != endln)\n {\n str = readln(fp);\n sum = sum + str;\n }\n\n printf(\"%d\", sum);\n}"
269
+ },
270
+ {
271
+ "image": "images/Consecutive1.JPEG",
272
+ "text": "#include <stdio.h>\n#include<iostream.h>\n\nvoid main() {\n int arr[20], n, temp = 0, con = 0;\n\n printf(\"Enter the number of elements:\\n\");\n scanf(\"%d\", &n);\n\n printf(\"Enter the array elements (0 or 1):\\n\");\n for (int i = 0; i < n; i++) {\n scanf(\"%d\", &arr[i]);\n }\n\n printf(\"\\n\");\n arr[n] = 0; \n\n for (int i = 0; i < n; i++) {\n if (arr[i] == 1) {\n temp++;\n\n if (arr[i + 1] == 0) { \n if (con < temp) {\n con = temp;\n }\n temp = 0;\n }\n }\n }\n\n printf(\"num of 1's are %d \\n\", con);\n}"
273
+ },
274
+ {
275
+ "image": "images/Stringman21.JPEG",
276
+ "text": "dict = {}\ncount = 0\nn = len(s)\n\nfor i in range(0, n + 1, 1):\n for j in range(0, i + 1, 1):\n if s[i] == s[j]:\n count ++\n dict.append(s[i]:count)\n else:\n count = 1\n dict.append(s[i]:count)\n\nprint(dict)"
277
+ },
278
+ {
279
+ "image": "images/Closest_value9.JPEG",
280
+ "text": "#include <stdio.h>\n\n\nvoid main()\n{\n int a[100], n, target, temp1, temp2, index;\n\n scanf(\"%d\", &n);\n\n for (int i = 0; i < n; i++) \n scanf(\"%d\", &a[i]); // Initializing array\n\n scanf(\"%d\", &target); // Initializing target\n\n temp2 = INT_MAX(); // Setting temp2 to the highest int value for the first iteration to be successful\n\n for (int i = 0; i < n; i++)\n {\n temp1 = a[i] - target;\n\n if (temp1 < 0)\n temp1 = temp1 * -1; // Converting the difference to a positive number for comparison\n\n if (temp1 < temp2)\n {\n temp2 = temp1; // Storing the least difference through each iteration\n index = i; // Storing the index\n }\n }\n\n printf(\"%d\", a[index]);\n}"
281
+ },
282
+ {
283
+ "image": "images/Print100_7.jpg",
284
+ "text": "void print()\n{\n s = 0;\n print(s);\n a = s + 1;\n print(a);\n goto (a);\n}"
285
+ },
286
+ {
287
+ "image": "images/File_han1.jpg",
288
+ "text": "def file_handle():\n file1 = \"input.txt\"\n\n # Read all the contents of file1 to file2\n file1.read()\n file2.write()\n\n num = arr.num\n sum = sum(arr)\n print(sum)\n\n return 0"
289
+ },
290
+ {
291
+ "image": "images/Listman7.JPEG",
292
+ "text": "Sample_list1 = [3, 1, 4, 1, 5, 9]\n\nSample_list2 = [2, 6, 5, 3, 5]\n\nSample_list3 = [ ]\n\nfor i in range(0, len( Sample_list1)):\n\n Sample_list3[i] = Sample_list1[i]"
293
+ },
294
+ {
295
+ "image": "images/Consecutive7.JPEG",
296
+ "text": "function arraymanipulation(L1[], L2[]): \n L3 = [] \n L3 = L1 + L2 ; result = [] \n\n for ele in L3: \n if ele not in result: \n result.append(L3) \n\n else : \n continue . \n\n return result.sort()"
297
+ },
298
+ {
299
+ "image": "images/Listman12.JPEG",
300
+ "text": "#include <stdio.h>\n\nvoid array()\n{\n s1 = [3, 1, 4, 5, 9];\n s2 = [2, 1, 5, 3, 5];\n\n s3 = append[s1, s2];\n\n print(s3);\n}"
301
+ },
302
+ {
303
+ "image": "images/Stringman10.JPEG",
304
+ "text": "Void occurance(String s):\n dict = { }\n word = s.split()\n\n for i in word:\n dict[i] = count(i)\n\n return dict"
305
+ },
306
+ {
307
+ "image": "images/Listman2.JPEG",
308
+ "text": "sl1 = [3, 1, 4, 1, 5, 9]\nsl2 = [2, 6, 5, 3, 5]\n\nl2 = length(sl2)\nl1 = length(sl1)\nl1.extend(l2) # Function to merge lists in Python\nc = l1\n\nfor i in range(l2):\n sl1[c] = sl2[i]\n c = c + 1\nl1 = length(sl1)\n\nfor i in range(l1):\n if(sl1.count(sl1[i] > 1) \n sl1.remove(sl1[i])\n \nsl1.sort()\nprint(sl1)\nfor i in range(l1-1):\n for j in range(l1-i-1):\n if(a[i] > a[j]):\n t = sl1[i]\n sl1[i] = sl1[j]\n sl1[j] = t\nprint(sl1)"
309
+ },
310
+ {
311
+ "image": "images/Stringman14.JPEG",
312
+ "text": "def char_count(s):\n dict1 = {} # Empty dictionary\n\n for i in s: # Iterate through string\n if i not in dict1: # Check presence of character\n dict1.add(i) # Add i as key of dictionary\n i.value = s.count(i) # Count the occurrences of i and add it as value of item\n\n return dict1 # Return dictionary\n\n for i, j in dict1.items():\n return f\"{i} : {j}\" # Print all items"
313
+ },
314
+ {
315
+ "image": "images/Consecutive17.JPEG",
316
+ "text": "#include <stdio.h>\n#include <stdlib.h>\n\nvoid max_one(int arr, int length) {\n int count = 0, max = 0;\n\n for (int i = 0; i <= length; i++) {\n if (arr[i] == 1) { // count no. of consecutive 1's\n count++;\n } else {\n count = 0; // reset when 0 comes\n }\n\n if (count > max) {\n max = count; // store max value\n }\n }\n printf(\"%d\", max);\n}\n\nvoid main() {\n int arr[50], len;\n\n printf(\"Enter the length of array: \");\n scanf(\"%d\", &len);\n\n printf(\"Enter the array: \");\n for (int i = 0; i < len; i++) {\n scanf(\"%d\", &arr[i]); // input\n }\n\n max_one(arr, len);\n}"
317
+ },
318
+ {
319
+ "image": "images/Print100_8.JPEG",
320
+ "text": "number = 0;\n\nprint_numbers(number) \n{\n printf(\"number + 1);\n}\n\nreturn_function() \n{\n while (number <= 100) \n {\n print_numbers(number);\n number = number + 1;\n }\n}\n\nreturn_function();"
321
+ },
322
+ {
323
+ "image": "images/Stringman5.JPEG",
324
+ "text": "#include <string.h>\n#include <stdio.h>\n\nint main()\n{\n int n, len, count;\n printf(\"Enter the string: \");\n \n scanf(\"%s\", &n);\n \n len = len(s);\n \n for(i = 0; i < len; i++)\n { \n if (str(n) = len(s)) \n {\n i++;\n }\n else\n {\n count = count + 1;\n }"
325
+ },
326
+ {
327
+ "image": "images/Listman15.JPEG",
328
+ "text": "def manipulate(list1, list2):\n list3 = list1.append(list2)\n \n list3 = list3.sort()\n \n # to remove duplicates\n for i in list3:\n for j in list3:\n if i == j:\n list3.pop(j)\n\n return list3"
329
+ },
330
+ {
331
+ "image": "images/Filehan7.JPEG",
332
+ "text": "#include <stdio.h>\n#include <stdlib.h>\n\nint sum(FILE fp)\n{\n int s = 0, i;\n\n while (geth(fp) != EOF)\n {\n i = gets(fp);\n s = s + i;\n }\n\n return s;\n}\n\nint main()\n{\n FILE *fp;\n fp = fopen(\"input.txt\", \"a\");\n a = sum(fp);\n printf(\"%d\", a);\n fclose(fp);\n}"
333
+ },
334
+ {
335
+ "image": "images/Listman6.JPEG",
336
+ "text": "def manipulate(list1, list2):\n\n list3 = list1.append(list2)\n\n list3 = list3.sort()\n \n # to remove duplicate.\n for i in list3:\n for j in list3:\n if i == j:\n list3.pop(j)\n\n return list3"
337
+ },
338
+ {
339
+ "image": "images/Stringman12.JPEG",
340
+ "text": "int count(char ch) // Consider size of s = 5\n{\n for(int i = 0; i < strlen(ch); i++)\n {\n if(strcmpi(ch[0], ch[i+1]) == 0)\n c++;\n\n if(strcmpi(ch[1], ch[i+1]) == 0)\n d++;\n\n if(strcmpi(ch[2], ch[i+1]) == 0)\n e++;\n\n if(strcmpi(ch[3], ch[i+1]) == 0)\n f++;\n\n if(strcmpi(ch[4], ch[i+1]) == 0)\n g++;\n }\n\n return\n {\n ch[0] = c;\n ch[1] = d;\n ch[2] = e;\n ch[3] = f;\n ch[4] = g;\n };\n}"
341
+ },
342
+ {
343
+ "image": "images/Filehan6.JPEG",
344
+ "text": "#include <stdio.h>\n\nvoid main()\n{\n FILE *fp;\n fp = fopen(\"input.txt\", \"r\");\n\n char str;\n int sum;\n\n while (str != endln)\n {\n str = readln(fp);\n sum = sum + str;\n }\n\n printf(\"%d\", sum);\n}"
345
+ },
346
+ {
347
+ "image": "images/File_han.jpg",
348
+ "text": "void file_read(filename) {\n int b, sum = 0;\n\n f1 = fopen(filename, \"r\");\n\n while (!f1.eof()) {\n f1.read(l);\n b = parseInt(l);\n sum = sum + b;\n }\n\n printf(\"Sum = %d\\n\", sum);\nvoid main() {\n file_read(\"Input.txt\");\n}"
349
+ },
350
+ {
351
+ "image": "images/Closest11.JPEG",
352
+ "text": "int A[10], i, n, k;\n\nprintf(\"Target number: \");\nscanf(\"%d\", &k);\n\nfor (i = 0; i < n; i++)\n{\n if (A[i] = k)\n printf(\"Output %d\", A[i]);\n\n else if (A[i] != k)\n printf(\"Output %d\", A[i]>k);\n\n else\n printf(\"Output %d\", A[n]);\n}"
353
+ },
354
+ {
355
+ "image": "images/Print100_6.JPEG",
356
+ "text": "void print()\n{\n int num;\n print(randomize num(100));\n}"
357
+ },
358
+ {
359
+ "image": "images/Consecutive6.JPEG",
360
+ "text": "L1 = input()\nList1 = list(L1)\n\ncount = 0\nonecount = []\n\nfor ele in list1\n if ele == 1: \n count += 1\n else:\n if count > 0:\n onecount.append(count)\n count = 0\n\nmax_count = max(onecount)\nprint(max_count)"
361
+ },
362
+ {
363
+ "image": "images/Listman10.JPEG",
364
+ "text": "sample_list1 = [3, 1, 4, 1, 5, 9]\nsample_list2 = [2, 6, 5, 3, 5]\n\nnew_list = sample_list1 + sample_list2\n\ntuple1 = ()\ntuple1 = tuple.new_list\n\nnew_list1 = list.tuple1\n\n\nprint(new_list.ascending)"
365
+ },
366
+ {
367
+ "image": "images/Listman17.JPEG",
368
+ "text": "list1 = [3, 1, 4, 1, 5, 9]\nlist2 = [2,6, 5, 3, 5]\n\ndef merge(list1, list2):\n list3 = []\n \n for i in list1:\n if i not in list3:\n list3.append[i]\n \n for j in list2:\n if j not in list3:\n list3.append[j]\n return list3\n\nprint(\"Merged list in ascending order:\")\nprint(list3.sort())"
369
+ },
370
+ {
371
+ "image": "images/Print100.JPEG",
372
+ "text": "print()\n{\n int n;\n n = 0;\n\n for (i=n; n <= 100; n++)\n {\n printf(\" \", n);\n }\n}"
373
+ },
374
+ {
375
+ "image": "images/Stringman15.JPEG",
376
+ "text": "set = {}\ntemp = 1\ncount = []\nstring = int(input())\n\nstring1 = string.split(' ')\narr = []\n\ndef strManipulation:\n for i in range[0, len(string1)]:\n for j in range[i+1, len(string1)]:\n if (string1[i] == string1[j]):\n count[i] = temp + 1\n else:\n count[i] = temp\n\n for i in range[0, len(string1)]:\n set = {string1[i]: count[i]}\n\n return set\n\nstrManipulation"
377
+ },
378
+ {
379
+ "image": "images/Stringman24.JPEG",
380
+ "text": "#include <stdio.h>\n\nvoid main() \n{\n char s[10];\n int count = 0;\n char a;\n\n printf(\"Enter the string: \");\n for (int i = 0; i != '\\0'; i++) \n {\n scanf(\" %s\", &s[i]);\n }\n\n for (int i = 0; i != '\\0'; i++) \n {\n a = s[i];\n for (int j = 0; j != '\\0'; j++) \n {\n if (s[i] != s[j]) \n {\n count = 1;\n } \n else if (s[i] == s[j]) \n {\n count++;\n }\n }\n printf(\"%s %d\", a, count);\n }\n}"
381
+ },
382
+ {
383
+ "image": "images/Listman13.JPEG",
384
+ "text": "def listadency(a):\n sample_list1 = int(input(a))\n sample_list2 = int(input(b))\n\n sample_list3 = {}\n sample_list3 = append(sample_list1(sample_list2))"
385
+ },
386
+ {
387
+ "image": "images/Stringman8.JPEG",
388
+ "text": "public static void (String s)\n{\n char ch = sc.newchar();\n int array[] = sc.nextArray[20];\n int length = s.length();\n\n for (i = 1; i <= length; i++)\n {\n System.out.println(\"char is \", i);\n\n for (j = 1; j <= length; j++)\n {\n System.out.println(\"count of each char\", j);\n }\n }\n\n for (i = 1; i <= length; i++)\n {\n for (j = 1; j <= length; j++)\n {\n System.out.println(\"char: count\", i, j);\n }\n }"
389
+ },
390
+ {
391
+ "image": "images/Stringman.JPEG",
392
+ "text": "function count(s):\n l = list(s.split(' '))\n dct = {}\n\n for i in l:\n if (i in dct):\n dct[i] = dct[i] + 1\n else:\n dct[i] = 0\n\n return dct"
393
+ },
394
+ {
395
+ "image": "images/Print100_1.JPEG",
396
+ "text": "#include <stdio.h>\nint main()\n{\n int first = 0, second = 1, third=2;\n\n printf(\"%d\", &first);\n printf(\"%d\", &second);\n while (third < 100)\n {\n printf(\"%d\", &third);\n third = third + second;\n third++;\n }"
397
+ },
398
+ {
399
+ "image": "images/Print100_15.JPEG",
400
+ "text": "# Using loop\nn = int(input(\"Enter a limit: \"))\n\nfor i in range(1 : n+1):\n print(i)\n\n# Without using loop\nn = int(input(\"Enter a limit: \"))"
401
+ },
402
+ {
403
+ "image": "images/Filehan5.JPEG",
404
+ "text": "def pgm2():\n File = input.txt.open(\"r\")\n list = File.read()\n sum = 0 \n for i in list: \n sum = sum + i \n\n return sum"
405
+ }
406
+ ]