Reorganized Everything
This commit is contained in:
4
various other things/python multiplier.py
Normal file
4
various other things/python multiplier.py
Normal file
@@ -0,0 +1,4 @@
|
||||
x = 5
|
||||
for x in range(1000):
|
||||
x*5
|
||||
print(x)
|
16
various other things/regex.py
Normal file
16
various other things/regex.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# import re library
|
||||
import re
|
||||
|
||||
# Here's our string
|
||||
lol = "Lol this is a string"
|
||||
print(lol)
|
||||
|
||||
# now let's filter out the word "string"
|
||||
p = re.compile('string')
|
||||
|
||||
filtered = p.match('string')
|
||||
|
||||
print(filtered)
|
||||
|
||||
|
||||
|
28
various other things/test.py
Normal file
28
various other things/test.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# imports libraries we will use
|
||||
import time
|
||||
import random
|
||||
# sets values we will use later
|
||||
number = 0
|
||||
phrase = "The quick, brown, fox jumped over the lazy dog"
|
||||
|
||||
# calculates amount of letters in phrase (including spaces)
|
||||
amount = len(phrase)
|
||||
print("The current phrase has", amount, "letters")
|
||||
# prints phrase
|
||||
print("the phrase is", phrase)
|
||||
print('begin loop')
|
||||
time.sleep(1)
|
||||
|
||||
# prints phrase letters
|
||||
for number in range(amount):
|
||||
print(number, phrase[number], end='\r')
|
||||
time.sleep(0.1)
|
||||
|
||||
# prints phrase letters in random order
|
||||
print('\n')
|
||||
print("Now, in random order!")
|
||||
time.sleep(1)
|
||||
for number in range(amount):
|
||||
exec('iteration = random.randint(0,amount - 1)')
|
||||
print(number, phrase[iteration], "iteration", iteration, end='\r')
|
||||
time.sleep(0.1)
|
Reference in New Issue
Block a user