Skip to content

Commit

Permalink
Change only the format but not the function
Browse files Browse the repository at this point in the history
... to let them pass the Python lint.
  • Loading branch information
LinjianLi committed Oct 17, 2020
1 parent c0ca74d commit 85d842e
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 68 deletions.
2 changes: 1 addition & 1 deletion A solution to project euler problem 3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""


def solution(n: int) -> int:
# def solution(n: int) -> int:
def solution(n: int = 600851475143) -> int:
"""Returns the largest prime factor of a given number n.
>>> solution(13195)
Expand Down
4 changes: 2 additions & 2 deletions BlackJack_game/blackjack.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
master
# master
# BLACK JACK - CASINO A GAME OF FORTUNE!!!
import time

# BLACK JACK - CASINO
# PYTHON CODE BASE


master
# master
import random

deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11] * 4
Expand Down
5 changes: 3 additions & 2 deletions Decimal_To_Binary.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

patch-2
# patch-255
decimal_accuracy = 7

def dtbconverter(num):
Expand Down Expand Up @@ -40,6 +40,7 @@ def dtbconverter(num):


#i think this code have not proper comment and noe this is easy to understand
'''
=======
Program: Decimal to Binary converter.
Expand All @@ -62,4 +63,4 @@ def DecimalToBinary(num):

# Calling function
DecimalToBinary(dec_val)
master
# master
44 changes: 22 additions & 22 deletions JARVIS/JARVIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# import modules
from datetime import datetime # datetime module supplies classes for manipulating dates and times
import subprocess # subprocess module allows you to spawn new processes
master
# master
import pyjokes

=======
# =======
from playsound import * #for sound output
master
# master
import speech_recognition as sr # speech_recognition Library for performing speech recognition with support for Google Speech Recognition, etc..

# pip install pyttsx3
Expand Down Expand Up @@ -63,7 +63,7 @@ def voice(p):


# Run Application with Voice Command Function
only_jarvis
# only_jarvis
class Jarvis:
def __init__(self, Q):
self.query = Q
Expand Down Expand Up @@ -110,9 +110,9 @@ def get_app(self):
print(task)
return

=======
# =======
def get_app(Q):
master
# master
if Q == "time":
print(datetime.now())
x=datetime.now()
Expand All @@ -131,7 +131,7 @@ def get_app(Q):
subprocess.call(['cmd.exe'])
elif Q == "browser":
subprocess.call(['C:\Program Files\Internet Explorer\iexplore.exe'])
patch-1
# patch-1
elif Q == "open youtube":
webbrowser.open("https://www.youtube.com/") # open youtube
elif Q == "open google":
Expand All @@ -151,27 +151,27 @@ def get_app(Q):
except Exception as e:
print(e)
speak("Sorray i am not send this mail")
=======
master
elif Q=="Take screenshot"
# =======
# master
elif Q=="Take screenshot":
snapshot=ImageGrab.grab()
drive_letter = "C:\\"
folder_name = r'downloaded-files'
folder_time = datetime.datetime.now().strftime("%Y-%m-%d_%I-%M-%S_%p")
extention = '.jpg'
folder_to_save_files = drive_letter + folder_name + folder_time + extention
snapshot.save(folder_to_save_files)
drive_letter = "C:\\"
folder_name = r'downloaded-files'
folder_time = datetime.datetime.now().strftime("%Y-%m-%d_%I-%M-%S_%p")
extention = '.jpg'
folder_to_save_files = drive_letter + folder_name + folder_time + extention
snapshot.save(folder_to_save_files)

elif Q=="Jokes":
print(pyjokes.get_joke())

master
# master
else:
engine.say("Sorry Try Again")
engine.runAndWait()

=======
=======
# =======
# =======

apps = {
"time": datetime.now(),
Expand All @@ -183,17 +183,17 @@ def get_app(Q):
"cmd": "cmd.exe",
"browser": "C:\Program Files\Internet Explorer\iexplore.exe"
}
master
# master

for app in apps:
if app == Q.lower():
subprocess.call([apps[app]])
break
master
# master
else:
engine.say("Sorry Try Again")
engine.runAndWait()
master
# master
return
# Call get_app(Query) Func.
Jarvis(Query).get_app
2 changes: 1 addition & 1 deletion Password Generator/pass_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def gen_password(sequence, passlength=8):
password = ''.join((secrets.choice(sequence) for i in range(passlength)))
return password

class Interface():
class Interface():
has_characters={
"lowercase":True,
"uppercase":True,
Expand Down
4 changes: 2 additions & 2 deletions Print_List_of_Odd_Numbers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master
# master
#Another best method to do this

n=map(list(int,input().split()))
Expand All @@ -9,7 +9,7 @@
# CALCULATE NUMBER OF ODD NUMBERS

# CALCULATE NUMBER OF ODD NUMBERS WITHIN A GIVEN LIMIT
master
# master

n = int(input("Enter the limit : ")) # user input

Expand Down
16 changes: 8 additions & 8 deletions Quick_Sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ def quickSort(arr, low, high):
print("Initial array is:", arr)
n = len(arr)
quickSort(arr, 0, n - 1)
patch-1
print("Sorted array is:", arr)
=======
# patch-1
# print("Sorted array is:", arr)
# =======
print("Sorted array is:")
patch-4
for i in range(0,n):
=======
# patch-4
# for i in range(0,n):
# =======
for i in range(0,len(arr)):
master
# master
print(arr[i],end=" ")

#your code is best but now it is easy to understand
master
# master
2 changes: 1 addition & 1 deletion SimpleCalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def divide(a, b):
except ZeroDivisionError:
return "Zero Division Error"

def power(a,b):
def power(a,b):
return a**b

def main():
Expand Down
6 changes: 3 additions & 3 deletions To print series 1,12,123,1234......py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master
# master
def num(a):

# initialising starting number
Expand Down Expand Up @@ -36,7 +36,7 @@ def num(a):
a = 5

num(a)
=======
# =======
# 1-12-123-1234 Pattern up to n lines

n = int(input("Enter number of rows: "))
Expand All @@ -46,4 +46,4 @@ def num(a):
print(j, end="")
print()

master
# master
4 changes: 2 additions & 2 deletions aj.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def Repeat(x):
if x[i] == x[j] and x[i] not in repeated:
repeated.append(x[i])
return repeated
ist1 = [10, 20, 30, 20, 20, 30, 40,
list1 = [10, 20, 30, 20, 20, 30, 40,
50, -20, 60, 60, -20, -20]
print (Repeat(list1))
print(Repeat(list1))
18 changes: 9 additions & 9 deletions binod.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
patch-1
# patch-1
import os #The OS module in python provides functions for interacting with the operating system

patch-3
# patch-3
# function to check if 'binod' is present in the file.
def checkBinod(file):
=======
# def checkBinod(file):
# =======

def checkBinod(file): #this function will check there is any 'Binod' text in file or not
with open(file, "r") as f: #we are opening file in read mode and using 'with' so need to take care of close()
=======
# def checkBinod(file): #this function will check there is any 'Binod' text in file or not
# with open(file, "r") as f: #we are opening file in read mode and using 'with' so need to take care of close()
# =======
import time
import os
#Importing our Bindoer
print("To Kaise Hai Ap Log!")
time.sleep(1)
print("Chaliye Binod Karte Hai!")
def checkBinod(file):#Trying to find Binod In File Insted Of Manohar Ka Kotha
master
# master
with open(file, "r") as f:
master
# master
fileContent = f.read()
if 'binod' in fileContent.lower():
print(
Expand Down
14 changes: 7 additions & 7 deletions Digital Clock/digital_clock.py → digital_clock.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
master
# master
# importing whole module
# use Tkinter to show a digital clock
# using python code base

import time
#because we need digital clock , so we are importing the time library.
master
# master
from tkinter import *
from tkinter.ttk import *

Expand All @@ -17,11 +17,11 @@
root = Tk()
root.title('Clock')

master
# master

# This function is used to
# display time on the label
def time():
def def_time():
string = strftime('%H:%M:%S %p')
lbl.config(text = string)
lbl.after(1000, time)
Expand All @@ -35,10 +35,10 @@ def time():
# Placing clock at the centre
# of the tkinter window
lbl.pack(anchor = 'center')
time()
def_time()

mainloop()
=======
# =======
label = Label(root, font=("Arial", 30, 'bold'), bg="black", fg="white", bd =30)
label.grid(row =0, column=1)

Expand All @@ -63,4 +63,4 @@ def dig_clock():
dig_clock()

root.mainloop()
master
# master
8 changes: 4 additions & 4 deletions helloworld.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
master
# master
# This program prints Hello, world!

import time
Expand All @@ -11,7 +11,7 @@
time.sleep(1)
print("Here We Go!")
time.sleep(1)
master
# master
print("Hello World!")
time.sleep(1)
print("A Quick Tip!")
Expand All @@ -21,11 +21,11 @@
# in c -> printf("Hello World!");
# in java -> System.out.println("Hello World!");
# in c++ -> cout << "Hello World";
master
# master
# in javascript - > console.log("Hello World");

# in javascript - > console.log("Hello World") or document.write("Hello World!")
time.sleep(2)
print("All The Best!")
#Adios!
master
# master
6 changes: 3 additions & 3 deletions json_to_table.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
import pandas as pd
//jsondata is a collection of data in json format
# //jsondata is a collection of data in json format

//Used panndas dataframe to convert json data to dataframes table
# //Used panndas dataframe to convert json data to dataframes table
jdata = json.loads(jsondata)
df = pd.DataFrame(jdata)
//print(df.T)
# //print(df.T)
1 change: 1 addition & 0 deletions news_articles__scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from newspaper import Article
import pickle
import re
import sys

# Extracting links for all the pages (1 to 158) of boomlive fake news section
fakearticle_links = []
Expand Down
2 changes: 1 addition & 1 deletion pygame.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
author-slayking1965
# author-slayking1965
"""
This is a game very similar to stone paper scissor
In this game :
Expand Down

0 comments on commit 85d842e

Please sign in to comment.