Skip to content

Instantly share code, notes, and snippets.

View charleyXuTO's full-sized avatar

Charley Xu charleyXuTO

View GitHub Profile
@charleyXuTO
charleyXuTO / guessTheNumber.py
Last active March 25, 2016 02:40
Guessing Number Game
import random
guessesTaken=0
myname=input("Hello! What is your name?")
number=random.randint(1,20) #The number that the user needs to guess
print('Well, ' +myname+ ', I am thinking of a number between 1 and 20. You have 5 tries to guess the number. Good luck! :)')
while guessesTaken<6:
@charleyXuTO
charleyXuTO / passwordgenerator.py
Created May 23, 2016 02:12
Python Password Generator
import random
passWords=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","@","#","%","^","&","*","1","2","3","4","5","6","7","8","9"]
n=int(input("How long do you want your password to be?"))
def passwordGenerator():
randomPassword=random.randint(0,40)
return passWords[randomPassword]
l=''.join([passwordGenerator() for i in range(n)])
print(l)
@charleyXuTO
charleyXuTO / AlarmClock.py
Created June 26, 2016 00:54
An Alarm Clock created using Python and Tkinter
import tkinter
import winsound
import time
import math
def countdown(count):
seconds=math.floor(count%60)