Surprise! I also write Python code! Who knew?



Here is a program that creates files containing randomly generated paragraphs, but calls them sentences because i'm to lazy to change it. You will have to pip install faker for it to work.



          
from faker import Faker
import random
fake = Faker()
# The file number to start on. 1 by default, but if you generated, say, 100 files before, and wanted to make more in the same file, then you would change it to 101
file_num = 1
# Change this to change the amount of files that will be created
files = 1
# The current word it is on. For cappitization and puncuation at the end.
current = 1
# Whether or not to capitalize the next word. Off by default.
cap_next = False
for i in range(files):
    letters = random.randint(15, 300)
    path = f">wanted path here< {file_num}.txt"
    with open(path, "w") as f:
        for _ in range(letters):
            word = fake.word()
            if current == 1:
                f.write(f'{word.capitalize()} ')
            elif current == letters:
                ending = random.randint(1, 3)
                if ending == 1:
                    f.write(f'{word}.')
                elif ending == 2:
                    f.write(f'{word}!')
                else:
                    f.write(f'{word}?')
            elif cap_next:
                f.write(f'{word.capitalize()} ')
                cap_next = False     
            else:
                random_action = random.randint(0, 10)
                if random_action < 1:
                    ending = random.randint(1, 3)
                    if ending == 1:
                        f.write(f'{word}. ')
                    elif ending == 2:
                        f.write(f'{word}! ')
                    else:
                        f.write(f'{word}? ')                        
                    cap_next = True
                elif random_action == 0 or random_action == 1:
                    f.write(f'{word}, ')
                elif random_action == 2:
                    f.write(f'{word}-') 
                else:          
                    f.write(f'{word} ')
            current += 1
    cap_next = False
    file_num += 1
    current = 1
print("Done.")
            
        

Spend Elon Musk's money, ~305 billion dollars. Not the most polished program ever.

            
            
prices = {
    "hamburger": 5,
    "ton of sand": 10,
    "book": 15,
    "video game": 60,
    "remarkable tablet": 400,
    "dog": 400,
    "cat": 450,
    "wolf pelt": 1000,
    "air jordans": 20000,
    "chevy silverado": 59000,
    "kidney": 442500,
    "small yacht": 500000,
    "mid yacht": 6000000,
    "nuke": 28000000,
    "mega yacht": 600000000,
    "mojang studios": 2500000000,
    "nba team": 4660000000,
    "nuclear weapons program": 94485000000,

}
purchase_history = []
items_bought = 0
money = 305000000000
while True:
    item = input("(No caps!) Please type what item you would like to purchase: (Tips: type: 'list' for a list of items, type: 'done' to end the game and see your final stats, type: 'stats' to see your stats without ending the game.) ")
    if item == "list":
        print(prices)
    elif item == "done":
        print(f"Purchase history:\n {purchase_history}\n")
        print(f"You purchased: {items_bought} items.\n")
        print(f"You had: ${money} left to spend.")
    elif item == "stats":
        print(f"Purchase history:\n {purchase_history}\n")
        print(f"You have purchased: {items_bought} items.\n")
        print(f"You have: ${money} left to spend.")
    elif item in prices:
        while True:
            amount = input("How many of that item would you like to purchase? (Int only!) ")
            try:
                amount = int(amount)
                break
            except ValueError:
                print("Invalid. Not an int (Number without decimals).")
        for i in range(amount):
            money -= prices[item]
            if money <= 0:
                money += prices[item]
                print("You cannot purchase anymore of that item!")
                break
        print(f"You purchased {amount} {item}s. Remaining money: {money}")
        purchase_history.append(item)
        purchase_history.append(amount)
        purchase_history.append("</>")
        items_bought = items_bought + amount
    else:
        print("Item not found.")
            
        
Back to main page.