Skip to content
Snippets Groups Projects
Commit 54957446 authored by Bayan Alkhuzaei CS2023's avatar Bayan Alkhuzaei CS2023
Browse files

Upload New File

parent c05f8f8c
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import random
from letters import file2pairs
import sys
file = sys.argv[1]
prev_letter = sys.argv[2]
letters_dict = file2pairs(file)
prob = letters_dict[prev_letter]
p_value = prob.values()
support = 'abcdefghijklmnopqrstuvwxyz '
answer = random.choices(support,p_value)
print(answer[0])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment