File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1027
1027
" utility"
1028
1028
],
1029
1029
"author" : " dostonnabotov"
1030
+ },
1031
+ {
1032
+ "title" : " Count Vowels" ,
1033
+ "description" : " Counts the number of vowels in a string." ,
1034
+ "code" : [
1035
+ " def count_vowels(s):" ,
1036
+ " vowels = 'aeiou'" ,
1037
+ " return len([char for char in s.lower() if char in vowels])" ,
1038
+ " " ,
1039
+ " # Usage:" ,
1040
+ " print(count_vowels('hello')) # Output: 2"
1041
+ ],
1042
+ "tags" : [
1043
+ " python" ,
1044
+ " string" ,
1045
+ " vowels" ,
1046
+ " count" ,
1047
+ " utility"
1048
+ ],
1049
+ "author" : " SteliosGee"
1050
+ },
1051
+ {
1052
+ "title" : " Check Anagram" ,
1053
+ "description" : " Checks if two strings are anagrams of each other." ,
1054
+ "code" : [
1055
+ " def is_anagram(s1, s2):" ,
1056
+ " return sorted(s1) == sorted(s2)" ,
1057
+ " " ,
1058
+ " # Usage:" ,
1059
+ " print(is_anagram('listen', 'silent')) # Output: True"
1060
+ ],
1061
+ "tags" : [
1062
+ " python" ,
1063
+ " string" ,
1064
+ " anagram" ,
1065
+ " check" ,
1066
+ " utility"
1067
+ ],
1068
+ "author" : " SteliosGee"
1069
+ },
1070
+ {
1071
+ "title" : " Remove Punctuation" ,
1072
+ "description" : " Removes punctuation from a string." ,
1073
+ "code" : [
1074
+ " import string" ,
1075
+ " " ,
1076
+ " def remove_punctuation(s):" ,
1077
+ " return s.translate(str.maketrans('', '', string.punctuation))" ,
1078
+ " " ,
1079
+ " # Usage:" ,
1080
+ " print(remove_punctuation('Hello, World!')) # Output: 'Hello World'"
1081
+ ],
1082
+ "tags" : [
1083
+ " python" ,
1084
+ " string" ,
1085
+ " punctuation" ,
1086
+ " remove" ,
1087
+ " utility"
1088
+ ],
1089
+ "author" : " SteliosGee"
1030
1090
}
1031
1091
]
1032
1092
},
You can’t perform that action at this time.
0 commit comments