This file contains hidden or 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
# del C:\Users\HackMeBabe\Downloads\Screenshot*.png in command prompt thankz K900 | |
import os | |
import re | |
regex=r'Screenshot \(?\d*\)?.png' #(.png|.jpg|.jpeg) | |
main_dir=os.getcwd() | |
i=0 | |
os.chdir('C:/Users/HackMeBabe/Downloads') #put your directory here. | |
for file in os.listdir(): | |
if re.findall(regex,file): | |
os.remove(file) |
This file contains hidden or 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
# Code written in PYTHON 3.6 | |
# Cow & Bulls Game - a game where a 4 digit number will be generated automatically and user have to guess that number. | |
# For every perfectly guessed digit at perfect place user get a cow | |
# For every perfectly guessed digit at wrong place user get a Bull {Bull = Total matching digit - cows} | |
# game continues untill player guess the number exactly {4 cows} At the end the code will show how many guess count. | |
# Any improvement suggestion are welcome. Am a learner ready to Learn new things. | |
import random |
This file contains hidden or 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 rockpaper | |
class Hero: | |
def __init__(self,name): | |
self.name=name | |
self.health=100 | |
def eat(self,food): | |
if (food=='apple'): | |
self.health-=100 | |
elif (food=='ham'): |
This file contains hidden or 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 random | |
def password(): | |
password_length=random.randint(8,18) | |
password_string='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.*_!@#$%^&' | |
for i in range(1,password_length): | |
print (random.choice(password_string),end='') | |
def gen_another(): |
This file contains hidden or 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
# Thank you ManyInterests(and reddit community) for suggestion and improving me. reddit link https://redd.it/6hu6k9 | |
def rps_winner(p1_move,p2_move,player1_name,player2_name): | |
a= 'rock' | |
b= 'scissors' | |
c= 'paper' | |
if p1_move==p2_move: | |
print("tie") | |
elif (p1_move==a and p2_move==b) or (p1_move==b and p2_move==c) or (p1_move==c and p2_move==a): |
This file contains hidden or 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
num=int(input("enter the number to check all its divisior: ")) | |
div_li=[] | |
for i in range(2,num): | |
if num%i==0: | |
div_li.append(i) | |
print(div_li) |