Python for Engineers
Solve Problems by Coding Solutions - A Complete solution for python programming
Blog Pages
(Move to ...)
Code
Top 10 Blogs
NumPy Tutorials
Distributions
Self Learning
IDE
About
▼
Hexagons Turtle
›
import turtle from random import randint x = 20 y = 20 turtle.speed(100) turtle.colormode(255) def move(l, a): turtle.right(...
Dijkstra’s shortest path algorithm
›
import sys class Graph(): def __init__(self, vertices): self.V = vertices self.graph = [[0 for column in range(vertices)] for ...
Range Queries for Frequencies of array elements
›
def findFrequency(arr, n, left, right, element): count = 0 for i in range(left - 1, right): if (arr[i] == element): count += 1 ...
Optimum location of point to minimize total distance
›
import math class Optimum_distance: class Point: def __init__(self, x, y): self.x = x self.y = y class Line: def __init__(...
Euler’s Totient function for all numbers smaller than or equal to n
›
def computeTotient(n): phi=[] for i in range(n + 2): phi.append(0) for i in range(1, n+1): phi[i] = i for p in range(2,n+1): ...
‹
›
Home
View web version