@c4syner/

Random Descriptive Animal Generator

Python

No description

fork
loading
Files
  • main.py
  • adj.csv
  • animals.csv
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pandas
def randAnimal(numAdj = 2): #Gets a random word from the provided files and then combines it with an animal
  if(numAdj < 0):
    return "SillyRabbitTricksAreForKids"
  myAdjs = []
  file1 = "adj.csv"
  i = 0
  while(i < numAdj):
    df = pandas.read_csv(file1)
    df = df.sample()
    randomTrashThatWillBeDeleted = df.iloc[0][0]
    myAdjs.append(randomTrashThatWillBeDeleted)
    i = i + 1
  df = pandas.read_csv('animals.csv', error_bad_lines=False)
  df = df.sample()

  myAnimal = df.iloc[0][0]
  i = 0
  myFullTitle = ""
  while(i < numAdj):
    myFullTitle = myFullTitle + ((myAdjs[i]).title())
    i = i + 1
  myFullTitle = myFullTitle + myAnimal.title()
  myFullTitle = myFullTitle.replace(" ", "")
  return myFullTitle
print(randAnimal(2))
#Change this to the number 
#of adjectives you want before the animal