This file contains 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
# Matrices forms an important Mathematical concepts, with wider adoption | |
# In this Tutorial, the aim is demonstrating addition and multiplication of matrices | |
# The below matrices, M1 and M2 are used for initial illustrations | |
M1 = [[8,14,-6], | |
[12,7,4], | |
[-11,3,21]] | |
M2 = [[3, 16, -6], | |
[9, 7, -4], | |
[-1, 3, 13]] | |
# To print the matrix, we thus do the following operation |
This file contains 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
# This functions works by taking wins, draws and losses and computing a teams total points | |
# In this scenario, a win = 3 points, a draw = 1 point and a loss = 0 points | |
onesTeamName = input("Enter the Name of your name : ") | |
wonMatches = input("Kindly enter the number of matches your team won : ") | |
if float(wonMatches) >= 40: | |
print("Error, please enter a valid number") | |
drawMatches = input("Kindly enter the number of matches your team draw : ") | |
if float(drawMatches) >= 40: | |
print("Error, please enter a valid number") | |
lossMatches = input("Kindly enter the number of matches your team lost : ") |
This file contains 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
* | |
{ | |
margin-left: 4px; | |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
} | |
.homecopy a | |
{ | |
text-decoration: none; | |
} | |
.contents |
This file contains 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
#In this basic variable assignment, A student learning Python was trying to make a function. | |
# His code should concatenate a passed string name with string "Edabit" and store it in a variable called result. | |
# He needs your help to fix this code | |
name_string = input("Enter the Passed String: ") | |
print("|==============================|") | |
print("You Entered: " , name_string) | |
result = name_string+("Edabit") | |
print("Your Result is: " + result) |
This file contains 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 create Fibonacci Sequence given that the user defines number of values | |
# First, use the "def" keyword to define the function | |
def fibonacciSequence(): | |
# Next, asking users to state the proportion or number of sequence terms to generate | |
numberOfTerms = int(input("Hi, enter number of terms to for the Sequence: ")) | |
# Defining the first two terms that are mandatory |
This file contains 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
Dalvik Virtual Machine | Android Run Time(ART) | |
---|---|---|
Faster Booting time | Rebooting is significantly longer | |
Cache builds up overtime | The cache is built during the first boot | |
Uses Just-In-Time(JIT) compiler | Uses Ahead-Of-Time(AOT) compiler | |
Occupies less space due to JIT | Consumes a lot of storage space internally due to AOT | |
Works best for small storage devices | Works best for Large storage devices | |
Longer app loading time | Extremely Faster and smoother load time and lower processor use | |
Apps lagging due to garbage collector pauses and JIT | Reduced apps lagging and better user experience | |
Lower installation time as compilation is done later | Longer as compilation is done at installation | |
DVM converts bytecode every time app is launched | ART converts just once at app installation. |
This file contains 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
# Create the Class | |
class founderInfo: | |
def __init__(self, firstName, secondName, age, annualSalary, status): | |
self.firstName = firstName | |
self.secondName = secondName | |
self.age = age | |
self.annualSalary = annualSalary | |
self.status = status | |
This file contains 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
# Implementation of the FIFO Property using Python Queues | |
# Class definition | |
class QueueData: | |
# An empty queue that will store the elements | |
def __init__(self): | |
self.data = [] | |
# enqueue() method | |
# Adding the first element e to the queue | |
def enqueue(self, e): |
This file contains 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 networkx as nx | |
import matplotlib.pyplot as plt | |
# Created empty Graph G | |
G = nx.Graph() | |
# Adding Edges to "G" using add_edge | |
G.add_edge(1, 2, weight = 12.5) | |
G.add_edge(3, 2, weight = 50.0) | |
G.add_edge(1, 3, weight = 17) |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script type="text/javascript"> | |
// Use parseInt to convert the entered string to integer | |
var x = parseInt(prompt("Enter First Number: ")); |
OlderNewer