(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to print a long text, convert the string to a list and print all the words and their frequencies. Sample Solution: Python Code : string_words = ”’United States Declaration of Independence From Wikipedia, the free encyclopedia The United States Declaration …
Day: February 21, 2021
Year 1 – Math Worksheet 012 – 2-D and 3-D Shapes Worksheets Applied Machine Learning & Data Science with Python, R and SQL. A list of Python, R and SQL Codes for Applied Machine Learning and Data Science https://setscholars.net/ Subscribe to our YouTube channel and press the ring to get latest update on …
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to create the combinations of 3 digit combo. Sample Solution: Python Code : numbers = [] for num in range(1000): num=str(num).zfill(3) print(num) numbers.append(num) Sample Output: 999 Write a Python program to create the combinations of 3 digit combo Free …
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to find unique triplets whose three elements gives the sum of zero from an array of n integers. Sample Solution: Python Code : def three_sum(nums): result = [] nums.sort() for i in range(len(nums)-2): if i> 0 and nums[i] == nums[i-1]: …
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to remove and print every third number from a list of numbers until the list becomes empty. Sample Solution: Python Code : def remove_nums(int_list): position = 3 – 1 idx = 0 len_list = (len(int_list)) while len_list>0: idx = (position+idx)%len_list …
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to create all possible strings by using ‘a’, ‘e’, ‘i’, ‘o’, ‘u’. Use the characters exactly once. Sample Solution: Python Code : import random char_list = [‘a’,’e’,’i’,’o’,’u’] random.shuffle(char_list) print(”.join(char_list)) Sample Output: iauoe Write a Python program to create all …