repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/fileinfo.py | fileinfo.py | # Script Name : fileinfo.py
# Author : Not sure where I got this from
# Created : 28th November 2011
# Last Modified : 23th March 2020
# Version : 1.0
# Modifications :
# Description : Show file information for a given file
# get file information using os.stat()
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/AreaOfTriangle.py | AreaOfTriangle.py | # Python Program to find the area of triangle when all three side-lengths are known!
a = 5
b = 6
c = 7
# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))
# calculate the semi-perimeter
s = (a + b +... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/is_number.py | is_number.py | # importing the module to check for all kinds of numbers truthiness in python.
import numbers
from math import pow
from typing import Any
# Assign values to author and version.
__author__ = "Nitkarsh Chourasia"
__version__ = "1.0.0"
__date__ = "2023-08-24"
def check_number(input_value: Any) -> str:
"""Check if i... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/find_cube_root.py | find_cube_root.py | # This method is called exhaustive numeration!
# I am checking every possible value
# that can be root of given x systematically
# Kinda brute forcing
def cubeRoot():
x = int(input("Enter an integer: "))
for ans in range(0, abs(x) + 1):
if ans**3 == abs(x):
break
if ans**3 != abs(x):
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/basic_cal.py | basic_cal.py | while True:
try:
print(eval(input("enter digits with operator (e.g. 5+5)\n")))
except:
print("Invalid Input, try again..")
# Simple Calculator using eval() in Python
# This calculator takes user input like "5+5" or "10/2" and shows the result.
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/googleweb.py | googleweb.py | from fuzzywuzzy import fuzz
import bs4
import requests
import numpy as np
import pandas as pd
requests.packages.urllib3.disable_warnings()
FinalResult = []
def SearchResults():
lis = []
f = open("Input", "r")
header = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/53... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ex20.py | ex20.py | from sys import argv
script, input_file = argv
def print_all(f):
print(f.read())
# seek(n) to read a file's content from byte-n
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print(line_count, f.readline())
current_file = open(input_file)
print("First let's print the whole file:\n")
pri... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/env_check.py | env_check.py | # Script Name : env_check.py
# Author : Craig Richards
# Created : 14th May 2012
# Last Modified : 14 February 2016
# Version : 1.0.1
# Modifications : 1.0.1 - Tidy up comments and syntax
# Description : This script will check to see if all of the environment variables I require are set
import... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/positiveNegetive.py | positiveNegetive.py | n = int(input("Enter number: "))
if n > 0:
print("Number is positive")
else:
print("Number is negative")
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/vigenere_cipher.py | vigenere_cipher.py | text = "mrttaqrhknsw ih puggrur"
custom_key = "happycoding"
def vigenere(message, key, direction=1):
key_index = 0
alphabet = "abcdefghijklmnopqrstuvwxyz"
final_message = ""
for char in message.lower():
# Append any non-letter character to the message
if not char.isalpha():
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Python-Array-Equilibrium-Index.py | Python-Array-Equilibrium-Index.py | """Array Equilibrium Index
Send Feedback
Find and return the equilibrium index of an array. Equilibrium index of an array is an index i such that the sum of elements at indices less than i is equal to the sum of elements at indices greater than i.
Element at index i is not included in either part.
If more than one equi... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ReadFromCSV.py | ReadFromCSV.py | __author__ = "vamsi"
import pandas as pd # pandas library to read csv file
from matplotlib import pyplot as plt # matplotlib library to visualise the data
from matplotlib import style
style.use("ggplot")
"""reading data from SalesData.csv file
and passing data to dataframe"""
df = pd.read_csv(r"..\SalesData.cs... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Snake-Water-Gun-Game.py | Snake-Water-Gun-Game.py | """
This is a snake water gun game similar to rock paper scissor
In this game :
if computer chooses snake and user chooses water, the snake will drink water and computer wins.
If computer chooses gun and user chooses water, the gun gets drown into water and user wins.
And so on for other cases
"""
# you can use this c... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/write_excel_file.py | write_excel_file.py | import xlwt # type: ignore
import openpyxl # type: ignore
# Workbook is created
xlwt_wb = xlwt.Workbook()
"""
we can also use of json object format for this file or code,
for the index we can use (for loop) and for data use json object.
example of json object:
{
"data":[
"ISBT DEHRADUN".
"SHASTRAD... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/prison_break_scrapper.py | prison_break_scrapper.py | """
Scrapper for downloading prison break
series from an open server and putting them in a designated folder.
"""
import os
import subprocess
import requests as req
from bs4 import BeautifulSoup as bs
BASE_URL = "http://dl.funsaber.net/serial/Prison%20Break/season%20"
def download_files(links, idx):
for link i... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Guess_the_number_game.py | Guess_the_number_game.py | # using codeSkulpter
import random
import simplegui
def new_game():
global num
print("new game starts")
def range_of_100():
global num
num = random.randrange(0, 100)
print("your range is 0-100")
def range_of_1000():
global num
num = random.randrange(0, 1000)
print("Your range is ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/new_pattern.py | new_pattern.py | def main():
"""Main function that gets user input and calls the pattern generation function."""
try:
lines = int(input("Enter number of lines: "))
if lines < 0:
raise ValueError("Number of lines must be non-negative")
result = pattern(lines)
print(result)
except V... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Secret message generator GUI by tkinter.py | Secret message generator GUI by tkinter.py | import tkinter
root = tkinter.Tk()
root.geometry("360x470")
root.title("SECRET MESSAGE CODER DECODER")
name1 = tkinter.StringVar()
name2 = tkinter.StringVar()
result1 = tkinter.StringVar()
r1 = tkinter.Label(
root,
text="",
textvariable=result1,
fg="green",
bg="white",
font=("lucida handwritin... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/read_excel_file.py | read_excel_file.py | # extract number of rows using Python
import xlrd
# Give the location of the file
loc = "sample.xlsx"
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
sheet.cell_value(0, 0)
# Extracting number of rows
print(sheet.nrows)
# extract number of columns in Python
print(sheet.ncols)
# extracting all columns name ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/insertion_sort.py | insertion_sort.py | # insertion sort
list = [] # declaring list
def input_list():
# taking length and then values of list as input from user
n = int(input("Enter number of elements in the list: ")) # taking value from user
for i in range(n):
temp = int(input("Enter element " + str(i + 1) + ": "))
list.appe... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/size(resolution)image.py | size(resolution)image.py | def jpeg_res(filename):
""" "This function prints the resolution of the jpeg image file passed into it"""
# open image for reading in binary mode
with open(filename, "rb") as img_file:
# height of image (in 2 bytes) is at 164th position
img_file.seek(163)
# read the 2 bytes
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/smart_file_organizer.py | smart_file_organizer.py | #!/usr/bin/env python3
"""
Smart File Organizer
A utility script to organize files in a specified directory into categorized
subfolders based on file types.
Example categories include: Images, Documents, Videos, Audios, Archives, Scripts, Others.
Usage:
python smart_file_organizer.py --path "C:\\Users\\YourName\... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/facebook id hack.py | facebook id hack.py | # Author-Kingslayer
# Email-kingslayer8509@gmail.com
# you need to create a file password.txt which contains all possible passwords
import requests
from bs4 import BeautifulSoup
import sys
if sys.version_info[0] != 3:
print(
"""--------------------------------------
REQUIRED PYTHON 3.x
use: python3 fb.py... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/armstrongnumber.py | armstrongnumber.py | # Python program to check if the number is an Armstrong number or not
# take input from the user
num = int(input("Enter a number: "))
# initialize sum
sum = 0
# find the sum of the cube of each digit
temp = num
while temp > 0:
digit = temp % 10
sum += digit**3
temp //= 10
# display the result
if num == ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/GroupSms_Way2.py | GroupSms_Way2.py | from __future__ import print_function
import sys
from getpass import getpass
import cookielib
import urllib2
try:
input = raw_input
except NameError:
pass
username = input("Enter mobile number:")
passwd = getpass()
message = input("Enter Message:")
# Fill the list with Recipients
x = input("Enter Mobile num... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/gui_calculator.py | gui_calculator.py | # Calculator
from tkinter import *
w = Tk()
w.geometry("500x500")
w.title("Calculatorax")
w.configure(bg="#03befc")
# Functions(Keypad)
def calc1():
b = txt1.get()
txt1.delete(0, END)
b1 = b + btn1["text"]
txt1.insert(0, b1)
def calc2():
b = txt1.get()
txt1.delete(0, END)
b1 = b + btn2[... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/script_count.py | script_count.py | from __future__ import print_function
import os # Load the library module
# Script Name : script_count.py
# Author : Craig Richards
# Created : 27th February 2012
# Last Modified : 20th July 2012
# Version : 1.3
# Modifications : 1.1 - 28-02-2012 - CR - Changed inside github and development functions, so... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/create password validity in python.py | create password validity in python.py | import time
pwd = input("Enter your password: ") # any password u want to set
def IInd_func():
count1 = 0
for j in range(5):
a = 0
count = 0
user_pwd = input("Enter remember password: ") # password you remember
for i in range(len(pwd)):
if user_pwd[i] == pwd[a]: ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/fetch_news.py | fetch_news.py | import requests
_NEWS_API = "https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey="
def fetch_bbc_news(bbc_news_api_key: str) -> None:
# fetching a list of articles in json format
bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json()
# each article in the list is a dict
for n... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/tik_tak.py | tik_tak.py | # Tik-tak game
board = ["anything", 1, 2, 3, 4, 5, 6, 7, 8, 9]
switch = "p1"
j = 9
print("\n\t\t\tTIK-TAC-TOE")
def print_board():
# import os
# os.system('cls')
print("\n\n")
print(" | |")
print("", board[1], " | ", board[2], " | ", board[3])
print("____|_____|____")
print(" |... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Trending youtube videos.py | Trending youtube videos.py | """
Python program that uses the YouTube Data API to fetch the top 10 trending YouTube videos.
You’ll need to have an API key from Google Cloud Platform to use the YouTube Data API.
First, install the google-api-python-client library if you haven’t already:
pip install google-api-python-client
Replace 'YOUR_API_KEY'... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Chrome Dino Automater.py | Chrome Dino Automater.py | import pyautogui # pip install pyautogui
from PIL import ImageGrab # pip install pillow
# from numpy import asarray
import time
def hit(key):
pyautogui.press(key)
return
def isCollide(data):
# for cactus
for i in range(329, 425):
for j in range(550, 650):
if data[i, j] < 100:
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/convert_time.py | convert_time.py | from __future__ import print_function
# Created by sarathkaul on 12/11/19
def convert_time(input_str):
# Checking if last two elements of time
# is AM and first two elements are 12
if input_str[-2:] == "AM" and input_str[:2] == "12":
return "00" + input_str[2:-2]
# remove the AM
elif inp... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/gstin_scraper.py | gstin_scraper.py | from bs4 import BeautifulSoup
import requests
import time
# Script Name : gstin_scraper.py
# Author : Purshotam
# Created : Sep 6, 2021 7:59 PM
# Last Modified : Oct 3, 2023 6:28 PM
# Version : 1.0
# Modifications :
""" Description :
GSTIN, short for Goods and Services Tax Identification Number,
is a uniq... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/binod.py | binod.py | # patch-1
# import os
# The OS module in python provides functions for interacting with the operating system
# patch-3
# function to check if 'binod' is present in the file.
# def checkBinod(file):
# =======
# def checkBinod(file): #this function will check there is any 'Binod' text in file or not
# with op... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/area_of_square_app.py | area_of_square_app.py | __author__ = "Nitkarsh Chourasia"
__author_GitHub_profile__ = "https://github.com/NitkarshChourasia"
__author_email_address__ = "playnitkarsh@gmal.com"
__created_on__ = "10/10/2021"
__last_updated__ = "10/10/2021"
from word2number import w2n
def convert_words_to_number(word_str):
"""
Convert a string contain... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/ph_email.py | ph_email.py | #!/usr/bin/python3
# find phone numbers and email addresses
# ./ph_email.py searches for phone numbers and emails in the latest clipboard
# entry and writes the matches into matches.txt
import re
import pyperclip
# Phone regex overview per line
# word boundary
# area code +91, 91, 0
# optional space
# ten numbers
#... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/add_two_number.py | add_two_number.py | user_input = (input("type type 'start' to run program:")).lower()
if user_input == "start":
is_game_running = True
else:
is_game_running = False
while is_game_running:
num1 = int(input("enter number 1:"))
num2 = int(input("enter number 2:"))
num3 = num1 + num2
print(f"sum of {num1} and {num2}... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Image_resize.py | Image_resize.py | def jpeg_res(filename):
""" "This function prints the resolution of the jpeg image file passed into it"""
# open image for reading in binary mode
with open(filename, "rb") as img_file:
# height of image (in 2 bytes) is at 164th position
img_file.seek(163)
# read the 2 bytes
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Random Password Generator.py | Random Password Generator.py | import random
low = "abcdefghijklmnopqrstuvwxyz"
upp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
num = "0123456789"
sym = "!@#$%^&*"
all = low + upp + num + sym
length = 8
password = "".join(random.sample(all, length))
print(password)
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/random_password_gen.py | random_password_gen.py | """
random_password_gen.py
A script to generate strong random passwords.
Usage:
$ python random_password_gen.py
Author: Keshavraj Pore
"""
import random
import string
def generate_password(length=12):
characters = string.ascii_letters + string.digits + string.punctuation
password = "".join(random.choice(ch... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/divisors_of_a_number.py | divisors_of_a_number.py | a = 0
while a <= 0:
number_to_divide = input("choose the number to divide -->")
try:
a = int(number_to_divide)
except ValueError:
a = 0
if a <= 0:
print("choose a number grether than 0")
list_number_divided = []
for number in range(1, a + 1):
b = a % number
if b == 0:
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/friday.py | friday.py | import pyttsx3
import os
var = 1
while var > 0:
pyttsx3.speak("How can I help you Sir")
print("How can I help you Sir : ", end="")
x = input()
if (("notepad" in x) or ("Notepad" in x)) and (
("open" in x) or ("run" in x) or ("Open" in x) or ("Run" in x)
):
pyttsx3.speak("Here it is... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/FIND FACTORIAL OF A NUMBER.py | FIND FACTORIAL OF A NUMBER.py | # Python program to find the factorial of a number provided by the user.
def factorial(n):
if n < 0: # factorial of number less than 0 is not possible
return "Oops!Factorial Not Possible"
elif (
n == 0
): # 0! = 1; when n=0 it returns 1 to the function which is calling it previously.
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/to check leap year.py | to check leap year.py | """
Leap Year Checker.
Determine whether a given year is a leap year.
Doctests:
>>> is_leap_year(2000)
True
>>> is_leap_year(1900)
False
>>> is_leap_year(2024)
True
>>> is_leap_year(2023)
False
"""
def is_leap_year(year: int) -> bool:
"""
Return True if year is a leap year, False otherwise.
Rules:
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/consonant.py | consonant.py | my_string = input("Enter a string to count number of consonants: ")
string_check = [
"a",
"e",
"i",
"o",
"u",
"A",
"E",
"I",
"O",
"U",
] # list for checking vowels
def count_con(string):
c = 0
for i in range(len(string)):
if (
string[i] not in strin... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Unit Digit of a raised to power b.py | Unit Digit of a raised to power b.py | def last_digit(a, b):
if b == 0: # This Code assumes that 0^0 is 1
return 1
elif a % 10 in [0, 5, 6, 1]:
return a % 10
elif b % 4 == 0:
return ((a % 10) ** 4) % 10
else:
return ((a % 10) ** (b % 4)) % 10
# Courtesy to https://brilliant.org/wiki/finding-the-last-digit-o... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/BruteForce.py | BruteForce.py | from itertools import product
def findPassword(chars, function, show=50, format_="%s"):
password = None
attempts = 0
size = 1
stop = False
while not stop:
# Obtém todas as combinações possíveis com os dígitos do parâmetro "chars".
for pw in product(chars, repeat=size):
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/google.py | google.py | """
Author: Ankit Agarwal (ankit167)
Usage: python google.py <keyword>
Description: Script googles the keyword and opens
top 5 (max) search results in separate
tabs in the browser
Version: 1.0
"""
import sys
import webbrowser
import bs4
import pyperclip
import requests
def main():
if l... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/print hello world.py | print hello world.py | # This program prints Hello, world!
print("Hello, world!")
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Binary_search.py | Binary_search.py | # It returns location of x in given array arr
# if present, else returns -1
def binary_search(arr, l, r, x):
# Base case: if left index is greater than right index, element is not present
if l > r:
return -1
# Calculate the mid index
mid = (l + r) // 2
# If element is present at the middle... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Memory_game.py | Memory_game.py | import random
import pygame
import sys
# Initialisation de pygame
pygame.init()
# Définir les couleurs
WHITE = (255, 255, 255)
PASTEL_PINK = (255, 182, 193)
PINK = (255, 105, 180)
LIGHT_PINK = (255, 182, 193)
GREY = (169, 169, 169)
# Définir les dimensions de la fenêtre
WIDTH = 600
HEIGHT = 600
FPS = 30
CARD_SIZE = ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/stackF_Harsh2255.py | stackF_Harsh2255.py | # Python program for implementation of stack
# import maxsize from sys module
# Used to return -infinite when stack is empty
from sys import maxsize
# Function to create a stack. It initializes size of stack as 0
def createStack():
stack = []
return stack
# Stack is empty when stack size is 0
def isEmpty(s... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Dictionary opperations (input,update a dict).py | Dictionary opperations (input,update a dict).py | # Update the value of dictionary written by the user...
print("Dictinary opperations")
def Dictionary(Dict, key, value):
print("Original dictionary", Dict)
Dict[key] = value
print("Updated dictionary", Dict)
d = eval(input("Enter the dictionary"))
print("Dictionary", d, "\n")
k = input("Enter the key ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/randomloadingmessage.py | randomloadingmessage.py | # Created by Nathan R (Mosrod)
# CREDIT TO https://github.com/1egoman/funnies/blob/master/src/funnies.js
from random import *
x = 1
for i in range(x):
num = randint(1, 80)
if num == 1:
print("Reticulating splines...")
if num == 2:
print("Swapping time and space...")
if num == 3:
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/dice_rolling_simulator.py | dice_rolling_simulator.py | # Made on May 27th, 2017
# Made by SlimxShadyx
# Editted by CaptMcTavish, June 17th, 2017
# Comments edits by SlimxShadyx, August 11th, 2017
# Dice Rolling Simulator
import random
try:
input = raw_input
except NameError:
pass
global user_exit_checker
user_exit_checker = "exit"
# Our start function (What t... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/pan.py | pan.py | import numpy as np
import pandas as pd
from matplotlib import *
# .........................Series.......................#
x1 = np.array([1, 2, 3, 4])
s = pd.Series(x1, index=[1, 2, 3, 4])
print(s)
# .......................DataFrame......................#
x2 = np.array([1, 2, 3, 4, 5, 6])
s = pd.DataFrame(x2)
print(... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/merge.py | merge.py | from __future__ import print_function
import os
# author:zhangshuyx@gmail.com
# !/usr/bin/env python
# -*- coding=utf-8 -*-
# define the result filename
resultfile = "result.csv"
# the merge func
def merge():
"""merge csv files to one file"""
# indicates use of a global variable.
global resultfile
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/SOUNDEX.py | SOUNDEX.py | # -*- coding: utf-8 -*-
def SOUNDEX(TERM: str):
# Step 0: Covert the TERM to UpperCase
TERM = TERM.upper()
TERM_LETTERS = [char for char in TERM if char.isalpha()]
# List the Remove occurrences of A, E, I, O, U, Y, H, W.
Remove_List = ("A", "E", "I", "O", "U", "Y", "H", "W")
# Save the first ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Reverse_list_in_groups.py | Reverse_list_in_groups.py | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Reverse_Linked_List:
def __init__(self):
self.head = None
def Insert_At_End(self, new_data):
new_node = Node(new_data)
if self.head is None:
self.head = new_node
r... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Detect_Remove_loop.py | Detect_Remove_loop.py | class Node:
def __init__(self, data):
self.data = data
self.next = None
class Linked_List:
def __init__(self):
self.head = None
def Insert_At_End(self, new_data):
new_node = Node(new_data)
if self.head is None:
self.head = new_node
return
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/letter_frequency.py | letter_frequency.py | # counting the number of occurrences of a letter in a string using defaultdict
# left space in starting for clarity
from collections import defaultdict
s = "mississippi"
d = defaultdict(int)
for k in s:
d[k] += 1
sorted(d.items())
print(d)
# OUTPUT --- [('i', 4), ('m', 1), ('p', 2), ('s', 4)]
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Palindrome_Checker.py | Palindrome_Checker.py | """
A simple method is , to reverse the string and and compare with original string.
If both are same that's means string is palindrome otherwise else.
"""
phrase = input()
if phrase == phrase[::-1]: # slicing technique
"""phrase[::-1] this code is for reverse a string very smartly"""
print("\n Wow!, The ph... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/check_file.py | check_file.py | # Script Name : check_file.py
# Author : Craig Richards
# Created : 20 May 2013
# Last Modified :
# Version : 1.0
# Modifications : with statement added to ensure correct file closure
# Description : Check a file exists and that we can read the file
from __future__ import print_function
import os # Import the... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/bodymass.py | bodymass.py | kilo = float(input("kilonuzu giriniz(örnek: 84.9): "))
boy = float(input("Boyunuzu m cinsinden giriniz: "))
vki = kilo / (boy**2)
if vki < 18.5:
print(f"vucut kitle indeksiniz: {vki} zayıfsınız.")
elif vki < 25:
print(f"vucut kitle indeksiniz: {vki} normalsiniz.")
elif vki < 30:
print(f"vucut kitle indek... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Hangman.py | Hangman.py | # importing the time module
import time
# importing the random module
import random
# welcoming the user
name = input("What is your name? ")
print("\nHello, " + name + "\nTime to play hangman!\n")
# wait for 1 second
time.sleep(1)
print("Start guessing...\nHint:It is a fruit")
time.sleep(0.5)
someWords = """apple... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/stack.py | stack.py | # Python program to reverse a string using stack
# Function to create an empty stack.
# It initializes size of stack as 0
def createStack():
stack = []
return stack
# Function to determine the size of the stack
def size(stack):
return len(stack)
# Stack is empty if the size is 0
def isEmpty(stack):
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Day_of_week.py | Day_of_week.py | # Python program to Find day of
# the week for a given date
import re # regular expressions
import calendar # module of python to provide useful fucntions related to calendar
import datetime # module of python to get the date and time
def process_date(user_input):
user_input = re.sub(r"/", " ", user_input) # ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/balance_parenthesis.py | balance_parenthesis.py | class Stack:
def __init__(self):
self.items = []
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def is_empty(self):
return self.items == []
def peek(self):
return self.items[-1]
def display(self):
return s... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/create_dir_if_not_there.py | create_dir_if_not_there.py | # Script Name : create_dir_if_not_there.py
# Author : Craig Richards
# Created : 09th January 2012
# Last Modified : 22nd October 2015
# Version : 1.0.1
# Modifications : Added exceptions
# : 1.0.1 Tidy up comments and syntax
#
# Description : Checks to see if a directory exists in ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/rotatelist.py | rotatelist.py | N = int(input("Enter The Size Of Array"))
list = []
for i in range(0, N):
temp = int(input("Enter The Intger Numbers"))
list.append(temp)
# Rotating Arrays Using Best Way:
# Left Rotation Of The List.
# Let's say we want to print list after its d number of rotations.
finalList = []
d = int(input("Enter The N... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/swap.py | swap.py | class Swapper:
"""
A class to perform swapping of two values.
Methods:
-------
swap_tuple_unpacking(self):
Swaps the values of x and y using a tuple unpacking method.
swap_temp_variable(self):
Swaps the values of x and y using a temporary variable.
swap_arithmetic_operatio... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/solution to euler project problem 10.py | solution to euler project problem 10.py | ##author-slayking1965
# """
# https://projecteuler.net/problem=10
# Problem Statement:
# The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
# Find the sum of all the primes below two million using Sieve_of_Eratosthenes:
# The sieve of Eratosthenes is one of the most efficient ways to find all primes
# smaller than n... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/To print series 1,12,123,1234......py | To print series 1,12,123,1234......py | # master
def num(a):
# initialising starting number
num = 1
# outer loop to handle number of rows
for i in range(0, a):
# re assigning num
num = 1
# inner loop to handle number of columns
# values changing acc. to outer loop
for k in range(0, i + 1):
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Encryption using base64.py | Encryption using base64.py | import base64
# Encryption
message = input()
message_bytes = message.encode("ascii")
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode("ascii")
print(base64_message)
# Decryption
base64_bytes = base64_message.encode("ascii")
message_bytes = base64.b64decode(base64_bytes)
message = me... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/encryptsys.py | encryptsys.py | import string
from random import randint
def decrypt():
texto = input("Input the text to decrypt : ").split(".")
abecedario = string.printable + "áéíóúÁÉÍÚÓàèìòùÀÈÌÒÙäëïöüÄËÏÖÜñÑ´"
abecedario2 = []
nummoves = int(texto[0])
indexs = []
finalindexs = []
textode1 = texto[1]
textode2 = []
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Calculator with simple ui.py | Calculator with simple ui.py | # Program make a simple calculator
class Calculator:
def __init__(self):
pass
def add(self, num1, num2):
"""
This function adds two numbers.
Examples:
>>> add(2, 3)
5
>>> add(5, 9)
14
>>> add(-1, 2)
1
"""
return ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/MobiusFunction.py | MobiusFunction.py | def is_square_free(factors):
"""
This functions takes a list of prime factors as input.
returns True if the factors are square free.
"""
for i in factors:
if factors.count(i) > 1:
return False
return True
def prime_factors(n):
"""
Returns prime factors of n as a lis... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/url_shortner.py | url_shortner.py | # Importing the required libraries.
import pyshorteners
from colorama import Fore # this module for font color
# Taking input from the user.
url = input("Enter URL: ")
# exception handling
try:
# Creating an instance of the pyshorteners library.
shortener = pyshorteners.Shortener()
# Shortening the URL ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/cloning_a_list.py | cloning_a_list.py | # Python program to copy or clone a list
# Using the Slice Operator
def Cloning(li1):
return li1[:]
# Driver Code
li1 = [4, 8, 2, 10, 15, 18]
li2 = Cloning(li1)
print("Original List:", li1)
print("After Cloning:", li2)
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/simulate_memory_cpu.py | simulate_memory_cpu.py | #! /user/bin/env python
# -*- encoding: utf-8 -*-
"""
Simulate cpu、 memory usage
"""
import sys
import re
import time
from multiprocessing import Process, cpu_count
def print_help():
print("Usage: ")
print(" python cpu_memory_simulator.py m 1GB")
print(" python cpu_memory_simulator.py c 1")
print("... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Sum of digits of a number.py | Sum of digits of a number.py | # Python code to calculate the sum of digits of a number, by taking number input from user.
import sys
def get_integer():
for i in range(
3, 0, -1
): # executes the loop 3 times. Giving 3 chances to the user.
num = input("enter a number:")
if num.isnumeric(): # checks if entered inp... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/multiple_comditions.py | multiple_comditions.py | while True:
try:
user = int(input("enter any number b/w 1-3\n"))
if user == 1:
print("in first if")
elif user == 2:
print("in second if")
elif user == 3:
print("in third if")
else:
print("Enter numbers b/w the range of 1-3")
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/daily_checks.py | daily_checks.py | # Script Name : daily_checks.py
# Author : Craig Richards
# Created : 07th December 2011
# Last Modified : 01st May 2013
# Version : 1.5
"""
Modifications : 1.1 Removed the static lines for the putty sessions, it now reads a file, loops through and makes the connections.
: 1.2 Added a variable filena... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/powers of 2.py | powers of 2.py | # Display the powers of 2 using anonymous function
terms = 10
# Uncomment code below to take input from the user
# terms = int(input("How many terms? "))
# use anonymous function
result = list(map(lambda x: 2**x, range(terms)))
print("The total terms are:", terms)
for i in range(terms):
print("2 raised to power... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/oneeven.py | oneeven.py | # Python Program to Print Even Numbers from 1 to N
maximum = int(input(" Please Enter the Maximum Value : "))
number = 1
while number <= maximum:
if number % 2 == 0:
print("{0}".format(number))
number = number + 1
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/pythonVideoDownloader.py | pythonVideoDownloader.py | import requests
from bs4 import BeautifulSoup
"""
URL of the archive web-page which provides link to
all video lectures. It would have been tiring to
download each video manually.
In this example, we first crawl the webpage to extract
all the links and then download videos.
"""
# specify the URL of the archive here
a... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/python_sms.py | python_sms.py | from __future__ import print_function
import os
import sqlite3
import urllib # URL functions
from time import strftime
import urllib2 # URL functions
# Script Name : python_sms.py
# Author : Craig Richards
# Created : 16th February 2017
# Last Modified :
# Version : 1.0
# Modifications :
# Description : This will ... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/quote.py | quote.py | # Sends inspirational quotes to the user using Zen Quotes API
# Format
"""
example quote -Quote Author Name
"""
import requests
from json import loads
def return_quote():
response = requests.get("https://zenquotes.io/api/random")
json_data = loads(response.text)
quote = (
json_data[0]["q"] + " -... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/random-sentences.py | random-sentences.py | """Generates Random Sentences
Creates a sentence by selecting a word at randowm from each of the lists in
the following order: 'article', 'nounce', 'verb', 'preposition',
'article' and 'noun'.
The second part produce a short story consisting of several of
these sentences -- Random Note Writer!!"""
import random
artic... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Merge_linked_list.py | Merge_linked_list.py | # Python3 program merge two sorted linked
# in third linked list using recursive.
# Node class
class Node:
def __init__(self, data):
self.data = data
self.next = None
# Constructor to initialize the node object
class LinkedList:
# Function to initialize head
def __init__(self):
se... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/add_two_nums.py | add_two_nums.py | __author__ = "Nitkarsh Chourasia"
__version__ = "1.0"
def addition(num1: typing.Union[int, float], num2: typing.Union[int, float]) -> str:
"""A function to add two given numbers."""
# Checking if the given parameters are numerical or not.
if not isinstance(num1, (int, float)):
return "Please inpu... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Base Converter Number system.py | Base Converter Number system.py | def base_check(xnumber, xbase):
for char in xnumber[len(xnumber) - 1]:
if int(char) >= int(xbase):
return False
return True
def convert_from_10(xnumber, xbase, arr, ybase):
if int(xbase) == 2 or int(xbase) == 4 or int(xbase) == 6 or int(xbase) == 8:
if xnumber == 0:
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/date-timeserver.py | date-timeserver.py | import socket
import time
soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
soc.bind((socket.gethostname(), 2905))
soc.listen(5)
while True:
clientsocket, addr = soc.accept()
print("estavlishes a connection from %s" % str(addr))
currentTime = time.ctime(time.time()) + "\r\n"
clientsocket.send(c... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/number guessing.py | number guessing.py | import random
attempts_list = []
def show_score():
if len(attempts_list) <= 0:
print("There is currently no high score, it's yours for the taking!")
else:
print("The current high score is {} attempts".format(min(attempts_list)))
def start_game():
random_number = int(random.randint(1, 10... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/large_files_reading.py | large_files_reading.py | with open(
"new_project.txt", "r", encoding="utf-8"
) as file: # replace "largefile.text" with your actual file name or with absoulte path
# encoding = "utf-8" is especially used when the file contains special characters....
for f in file:
print(f.strip())
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/jee_result.py | jee_result.py | import datetime
import mechanize
from bs4 import BeautifulSoup
# Create a Browser
b = mechanize.Browser()
# Disable loading robots.txt
b.set_handle_robots(False)
b.addheaders = [("User-agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98;)")]
# Navigate
b.open("http://cbseresults.nic.in/jee/jee_2015.htm")
# Cho... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/mapit.py | mapit.py | import sys
import webbrowser
import pyperclip
if len(sys.argv) > 1:
address = " ".join(sys.argv[1:])
elif len(pyperclip.paste()) > 2:
address = pyperclip.paste()
else:
address = input("enter your palce")
webbrowser.open("https://www.google.com/maps/place/" + address)
| python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/sum_of_digits_of_a_number.py | sum_of_digits_of_a_number.py | """
A simple program to calculate the sum of digits of a user-input integer.
Features:
- Input validation with limited attempts.
- Graceful exit if attempts are exhausted.
- Sum of digits computed iteratively.
Doctests:
>>> sum_of_digits(123)
6
>>> sum_of_digits(0)
0
>>> sum_of_digits(999)
27
... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
geekcomputers/Python | https://github.com/geekcomputers/Python/blob/21cbdf223aadd1c28293570d1106fe47af6e9434/Shortest Distance between Two Lines.py | Shortest Distance between Two Lines.py | import math
import numpy as NP
LC1 = eval(input("Enter DRs of Line 1 : "))
LP1 = eval(input("Enter Coordinate through which Line 1 passes : "))
LC2 = eval(input("Enter DRs of Line 2 : "))
LP2 = eval(input("Enter Coordinate through which Line 2 passes : "))
a1, b1, c1, a2, b2, c2 = LC1[0], LC1[1], LC1[2], LC2[0], LC2[1... | python | MIT | 21cbdf223aadd1c28293570d1106fe47af6e9434 | 2026-01-04T14:42:18.827821Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.