For this analysis, i'll be using a Reddit API wrapper, called "praw", to loop through the /r/politics subreddit headlines. In [1]: from IPython import display import math from pprint import pprint import pandas as pd import numpy as np import nltk import matplotlib.pyplot as plt import seaborn as sns sns.set(style='darkgrid', context='talk', palette='Dark2') In [2]: """ For this … Continue reading Sentiment-analysis-Raddit-api
Author: theone9807
Coin Flip Simulation
Coin Flip Simulation - Write some code that simulates flipping a single coin however many times the user decides. The code should record the outcomes and count the number of tails and heads. """ Q: Coin Flip Simulation - Write some code that simulates flipping a single coin however many times the user decides. The … Continue reading Coin Flip Simulation
Calculator
Calculator - A simple calculator to do basic operators. Make it a scientific calculator for added complexity. """ Q: Calculator - A simple calculator to do basic operators. Make it a scientific calculator for added complexity. """ def calculator(a, b, op): if op not in '+-/*': return 'Please only type one of these characters: "+, … Continue reading Calculator
Binary to Decimal and Back Converter
Q: Binary to Decimal and Back Converter - Develop a converter to convert a decimal number to binary or a binary number to its decimal equivalent. """ Q: Binary to Decimal and Back Converter - Develop a converter to convert a decimal number to binary or a binary number to its decimal equivalent. """ # … Continue reading Binary to Decimal and Back Converter
Change Return Program
""" Q. Change Return Program - The user enters a cost and then the amount of money given. The program will figure out the change and the number of quarters, dimes, nickels, pennies needed for the change. """ #import math module import math def Change_Return_Program(denom,money): i = 0 used= [0]*len(denom) while(money >0):# go until all … Continue reading Change Return Program
Next Prime Number-Python
#Q. Next Prime Number - Have the program find prime numbers until the user chooses to stop asking for the next one. def is_prime(x): if x == 2: return True if x % 2 == 0: return False for i in range(3, int(x**0.5)+1, 2): if x % i == 0: return False return True def … Continue reading Next Prime Number-Python
SSL-Certificate-checker
import requests from bs4 import BeautifulSoup as bs import re url = "https://matlabhelpers.com/" page = requests.get(url) soup = bs(page.content , 'html.parser') head = soup.find('head') # re.findall(r'[^<]+', str(head)) #SSL secure ssl = soup.find(attrs={"rel": re.compile(r'canonical', re.I)}) # ssl['href'] if re.search('(https:)', ssl['href']): print('SSL Secure!!!') else: print('Bad news your website is not SSL secure')
Data Visualization-II (Python)
# Data-visualization-2 In the second part of data visualization,Almost all the plot in this repo is drawn using "Seaborn" library: >The boxplot is drawn with the randomely generated data, >Data visualization of the iris data is also show >Reg plot is also drawn >lmplot is also ploted >And also you will learn how to make … Continue reading Data Visualization-II (Python)
Alarm Clock -Using Python
Alarm Clock - A simple clock where it plays a sound after X number of minutes/seconds or at a partic Code to make an Alarm clock using Python In [16]: #this module are pre installed with python import winsound, time, os, platform In [17]: def user_input(): """taking user input""" hour = int(input('Enter Hours: ')) minute = int(input('Enter … Continue reading Alarm Clock -Using Python
map()
map() is a built-in Python function that takes in two or more arguments: a function and one or more iterables, in the form: map(function, iterable, ...) map() returns an iterator - that is, map() returns a special object that yields one result at a time as needed. We will learn more about iterators and generators … Continue reading map()
