This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int n , k ,w; | |
int i ,sum = 0; | |
int dollar; | |
scanf("%d %d %d",&k,&n,&w); | |
for(i = 1;i <= w;i++) | |
{ | |
sum = sum + i*k; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyqrcode | |
def qrcode(): | |
q = pyqrcode.create(input()) | |
q.png('gen_qrcode.png',scale=7) | |
print('qrcode generated') | |
if __name__=='__main__': | |
qrcode() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import needed libraries | |
import tensorflow.compat.v1 as tf | |
tf.disable_v2_behavior() | |
import numpy as np | |
import matplotlib.pyplot as plt | |
#set the hyper-parameters | |
learning_rate = 0.001 | |
training_epochs = 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Function to check two strings are anagrams or not | |
def anagrams(s1,s2): | |
""" | |
we first check if both strings have the same length | |
because if they're not it's impossible for them to | |
be anagrams. | |
""" | |
if len(s1) != len(s2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
def anagrams(s1,s2): | |
""" | |
As seen in method 2, we first check if both strings have the | |
same length because if they're not it's impossible for them | |
to be anagrams. | |
""" | |
if len(s1) != len(s2): | |
return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def anagrams(s1,s2): | |
if len(s1) != len(s2): | |
return False | |
return sorted(s1) == sorted(s2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import uniform distribution | |
from scipy.stats import uniform | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
#taking random variables from uniform distribution | |
data = uniform.rvs(size = 10000,loc = 5,scale = 10) | |
#plotting the uniform data | |
ax = sns.distplot(data, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing required libraries | |
from scipy.stats import norm | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
#creating the normal distribution | |
data = norm.rvs(size=10000,loc=0,scale=1) | |
#plotting the data | |
ax = sns.distplot(data, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing required libraries | |
from scipy.stats import expon | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
#creating the exponential distribution | |
data = expon.rvs(loc=0,scale=10,size=10000) | |
#plotting the data | |
ax = sns.distplot(data, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing required libraries | |
from scipy.stats import binom | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
#creating the binomial distribution | |
data = binom.rvs(n=20,p=0.7,size=10000) | |
#plotting the data | |
ax = sns.distplot(data, |
OlderNewer