Validating phone numbers

A valid mobile number is a ten digit number starting with 7,8,9

import re # input numbers = [input() for i in range(int(input()))] # regex regex = re.compile(r"^(7|8|9)([0-9]){9}$") # Check for number in numbers: if regex.match(number): print('YES') else: print('NO')

How do central banks control inflation?

The US Federal Reserve typically designs financial policy to achieve an inflation target of 2%. Inflation targeting is a central banking policy that revolves around adjusting monetary policy to achieve a specified annual rate of inflation. Interest rates can be seen as a mechanism or tool to achieve inflation targeting. When inflation is high, banks will raise interest rates. This has a trickle down effect starting with central banks, going down to commercial banks, and eventually down to commercial bank clients such as businesses and individual consumers.

Automatic Number Plate Recognition

This is a manual process and you need to do it for all the images. Be careful while doing labeling because the labeling process has a direct impact on the accuracy of the model.

Kitty's Calculations on a Tree

The first line contains an integer,k , the size of the set. The second line contains k space-separated integers, the set's elements.

# Enter your code here. Read input from STDIN. Print output to STDOUT from itertools import combinations from queue import Queue from collections import defaultdict as dd,deque def find_shortest_path(graph, start, end): dist = {start: [start]} que = deque() que.append(start) while len(que): at = que.popleft() for next in graph[at]: if next not in dist: dist[next] = dist[at]+[next] que.append(next) return dist.get(end) def add(d,a,b): d[a].append(b) d[b].append(a) if __name__=='__main__': d=dd(list) t,q=map(int,input().split()) for _ in range(t-1): a,b=map(int,input().split()) add(d,a,b) for _ in range(q): k=int(input()) l=list(map(int,input().split())) if len(l)>1: s=list(combinations(l,2)) sum=0 for j in s: u,v=j p=find_shortest_path(d,u,v) dist=len(p)-1 sum=sum+(u*v*dist) result=sum%((10**9)+7) print(result) else: print(0) continue

Merge the tools!

we have to split into sub strings

def merge_the_tools(string, k): # your code goes here substring = f"" for position, value in enumerate(string): if value not in substring: substring += value if (position+1) % k == 0: print(substring) substring = f"" if __name__ == '__main__':

The Minion Game

Both players are given the same string, . Both players have to make substrings using the letters of the string . Stuart has to make words starting with consonants. Kevin has to make words starting with vowels. The game ends when both players have made all possible substrings. string: the winner's name and score, separated by a space on one line, or Draw if there is no winner

def minion_game(string: str) -> None: """Print the winner of the game and the score.""" kevin = stuart = 0 length: int = len(string) for i, char in enumerate(string): points: int = length - i if char in {"A", "E", "I", "O", "U"}: kevin += points else: stuart += points if kevin == stuart: print("Draw") else: print(*("Stuart", stuart) if stuart > kevin else ("Kevin", kevin)) if __name__ == '__main__': s = input() minion_game(s)

titanic classification
import pandas as pd df = pd.read_csv("/content/titanic.csv") df.head() inputs = df.drop(['Survived','PassengerId','Name','SibSp','Parch','Ticket','Cabin','Embarked'],axis='columns') inputs.head(10) inputs.isnull().sum() inputs['Age'].fillna(inputs['Age'].mean(),inplace=True) inputs.isnull().sum() target = df['Survived'] target.head(10) from sklearn.preprocessing import LabelEncoder le_Pclass = LabelEncoder() le_Sex = LabelEncoder() le_Age = LabelEncoder() inputs['Pclass_n'] = le_Pclass.fit_transform(inputs['Pclass']) inputs['Sex_n'] = le_Sex.fit_transform(inputs['Sex']) inputs['Age_n'] = le_Age.fit_transform(inputs['Age']) inputs inputs_n = inputs.drop(['Pclass','Sex','Age'],axis='columns') inputs_n.head(10) target from sklearn import tree model = tree.DecisionTreeClassifier(), target) model.score(inputs_n,target) #predicting model.predict([[53.1000,0,0,47]]) from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(inputs_n,target,test_size=0.2) len(X_train) len(X_test) from sklearn import tree model = tree.DecisionTreeClassifier(),y_train) model.score(X_test,y_test) #acurcy : 78.77094972067039 from sklearn.metrics import classification_report,confusion_matrix predictions = model.predict(X_test) print(classification_report(y_test,predictions)) print(confusion_matrix(y_test,predictions))


Bike Crash severity using logistic regression

cows and bulls game

Clinical Database based on Heart  Disease Prediction using Machine Learning

•To assist Cardiologist for Better diagnosis  at early phase. •To develop a robust Machine Learning  Model to predict Heart Disease with Accuarcy of 99%.

credit card fraud detection using cnn
1 2 ... 45
  • Our company starts its operations

    Some placeholder content in a paragraph relating to "Our company starts its operations". And some more content, used here just to pad out and fill this tab panel...

    11 March 2020

  • First customer

    Some placeholder content in a paragraph relating to "First customer". And some more content, used here just to pad out and fill this tab panel...

    19 March 2020

  • Our team exceeds 10 people

    Some placeholder content in a paragraph relating to "Our team exceeds 10 people". And some more content, used here just to pad out and fill this tab panel...

    24 June 2020

  • View all