@malvoliothegood/

random-first-name

Python

No description

fork
loading
Files
  • main.py
  • christian_names.txt

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.28443963226261393","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyBJbXBvcnQgcmFuZGludCBtZXRob2QgYW5kIGFsaXMgaXQgYXMgcmludCwgZm9yIGJyZXZpdHkKZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQgYXMgcmludAoKcXVlc3Rpb24gPSBzdHIoaW5wdXQoIklzIHRoZXJlIGFueXRoaW5nIEkgY2FuIGhlbHAgeW91IHdpdGg/IChlbnRlciB5ZXMgb3Igbm8pICIpKQojIExvd2VyY2FzZSBpbnB1dCBzbyBZZXMveWVzIGFuZCBOby9ubyBhcmUgYWNjZXB0YWJsZQpxdWVzdGlvbiA9IHF1ZXN0aW9uLmxvd2VyKCkKaWYgcXVlc3Rpb24gPT0gInllcyIgb3IgcXVlc3Rpb24gPT0gIm5vIjoKICBuYW1lID0gaW5wdXQoIk9rIEkgd2lsbCBoZWxwIHlvdSBzb29uPyBCdXQsIGZpcnN0IHRlbGwgbWUgeW91ciBuYW1lOiAiKQogICMgUmVhZCB0aGUgY29udGVudHMgb2YgdGhlIGZpbGUgaW50byBhIGxpc3QKICB3aXRoIG9wZW4oJ2NocmlzdGlhbl9uYW1lcy50eHQnKSBhcyBmOgogICAgICBsaW5lcyA9IGYucmVhZCgpLnNwbGl0bGluZXMoKQoKICByYW5kb21faW5kZXggPSByaW50KDAsIGxlbihsaW5lcykpCiAgbXluYW1lID0gbGluZXNbcmFuZG9tX2luZGV4XQoKICBwcmludCgiSGVsbG8gIiArIG5hbWUgKyAiLCIgKyAgIiBteSBuYW1lIGlzICIgKyBteW5hbWUp"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Import randint method and alis it as rint, for brevity
from random import randint as rint

question = str(input("Is there anything I can help you with? (enter yes or no) "))
# Lowercase input so Yes/yes and No/no are acceptable
question = question.lower()
if question == "yes" or question == "no":
  name = input("Ok I will help you soon? But, first tell me your name: ")
  # Read the contents of the file into a list
  with open('christian_names.txt') as f:
      lines = f.read().splitlines()

  random_index = rint(0, len(lines))
  myname = lines[random_index]

  print("Hello " + name + "," +  " my name is " + myname)