Skip to content

Instantly share code, notes, and snippets.

View Prajwalprakash3722's full-sized avatar
⛰️
consistency is the key :)

Prajwal prakash Prajwalprakash3722

⛰️
consistency is the key :)
View GitHub Profile
@Prajwalprakash3722
Prajwalprakash3722 / regex,py
Created May 11, 2021 16:20
Credit card validation
import re
def validation():
t = int(input().strip())
for _ in range(t):
num = "".join(input())
if (re.match(r'^[456]', num) and
(re.match(r'([\d]{4}-){3}[\d]{4}$', num) or
re.match(r'[\d]{16}', num)) and
cd Vaccine_availability
streamlit run home.py
import cv2 # we are importing the cv2 module from opencv
image_path = '/home/prajwal/OpenCv/image_1.jpeg' #change this path by your image path
image = cv2.imread(image_path) # Reading of image
cv2.imshow('Image-Reading', image) # Image output in new Window
cv2.waitKey(0)
namespace Vehicle {
class Bike {
user: User;
constructor(public inputUser: User) {
this.user = inputUser;
}
getName() {
return this.user.name;
}
}
namespace Vehicle {
export class Bike {
user: User;
constructor(public inputUser: User) {
this.user = inputUser;
}
getName() {
return this.user.name;
}
}
//todo.types.ts
export namespace Todo {
export interface TodoObject {
id: string;
title: string;
completed: boolean;
}
import { Todo } from "@todo.types.ts";
class TodosApi {
getTodos(params: Todo.Controllers.Get.Request) {
return http.get<Todo.Controllers.Get.Response>('/todos', {
params,
});
}
addTodo(todo: Todo.Controllers.Add.Request) {
const arr = [1, 2, 3, 4, 5];
arr.forEach((element) => {
console.log(element * 2);
});
const arr = [1, 2, 3, 4, 5];
const newArr = arr.map((element) => {
return element * 2;
});
console.log(newArr);
const arr = [1, 2, 3, 4, 5];
const newArr = arr
.map((element) => {
return element * 2;
})
.filter((element) => {
return element > 5;
});
console.log(newArr);