Improved Code and removed warnings (#482)

Improved Code and removed warnings
This commit is contained in:
Parth Shandilya 2018-10-19 13:28:21 +05:30 committed by GitHub
parent fedb3e70ab
commit 07451a6ca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 33 additions and 12 deletions

View File

@ -37,7 +37,7 @@ def computeAP(l):
for x in range(len(isArt)):
if isArt[x] == True:
print(x, end=" ")
print(x)
# Adjacency list of graph
l = {0:[1,2], 1:[0,2], 2:[0,1,3,5], 3:[2,4], 4:[3], 5:[2,6,8], 6:[5,7], 7:[6,8], 8:[5,7]}

View File

@ -101,8 +101,8 @@ def PrimsAlgorithm(l):
return TreeEdges
# < --------- Prims Algorithm --------- >
n = int(input("Enter number of vertices: "))
e = int(input("Enter number of edges: "))
n = int(raw_input("Enter number of vertices: "))
e = int(raw_input("Enter number of edges: "))
adjlist = defaultdict(list)
for x in range(e):
l = [int(x) for x in input().split()]

View File

@ -9,7 +9,7 @@ def isPositiveInteger(limit):
def main():
limit = int(input("How many terms to include in fibonacci series: "))
if isPositiveInteger(limit):
print(f"The first {limit} terms of the fibonacci series are as follows:")
print("The first {limit} terms of the fibonacci series are as follows:")
print([recur_fibo(n) for n in range(limit)])
else:
print("Please enter a positive integer: ")

View File

@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8
'''
A Framework of Back Propagation Neural NetworkBP model

View File

@ -9,4 +9,4 @@ T = int(input().strip())
ls = []
for _ in range(T):
fib(int(input().strip()))
print(*ls, sep = '\n')
print(ls, sep = '\n')

View File

@ -3,7 +3,7 @@ Problem:
The prime factors of 13195 are 5,7,13 and 29. What is the largest prime factor of a given number N?
e.g. for 10, largest prime factor = 5. For 17, largest prime factor = 17.
'''
from __future__ import print_function
from __future__ import print_function, division
import math

View File

@ -1,4 +1,8 @@
# Author: OMKAR PATHAK
#!/usr/bin/python
# encoding=utf8
""" Author: OMKAR PATHAK """
from __future__ import print_function

View File

@ -1,4 +1,7 @@
# Author: OMKAR PATHAK
#!/usr/bin/python
# encoding=utf8
""" Author: OMKAR PATHAK """
from __future__ import print_function

View File

@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8
from __future__ import print_function
# Author: OMKAR PATHAK

View File

@ -1,6 +1,6 @@
#!/usr/bin/python
from __future__ import print_function
from __future__ import print_function, division
try:
raw_input # Python 2

View File

@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8
"""
This program calculates the nth Fibonacci number in O(log(n)).
It's possible to calculate F(1000000) in less than a second.

View File

@ -1,7 +1,7 @@
"""
Implementation of gradient descent algorithm for minimizing cost of a linear hypothesis function.
"""
from __future__ import print_function
from __future__ import print_function, division
import numpy
# List of input, output pairs

View File

@ -1,8 +1,10 @@
'''
#!/usr/bin/python
# encoding=utf8
"""
The FisherYates shuffle is an algorithm for generating a random permutation of a finite sequence.
For more details visit
wikipedia/Fischer-Yates-Shuffle.
'''
"""
import random
def FYshuffle(LIST):

View File

@ -1,3 +1,6 @@
#!/usr/bin/python
# encoding=utf8
'''Author Anurag Kumar | anuragkumarak95@gmail.com | git/anuragkumarak95
Simple example of Fractal generation using recursive function.