import random
import sqlite3

import praw

def getRandomJoke():
    conn = sqlite3.connect('Top_jokes.db')
    c = conn.cursor()
    numColumns = c.execute('SELECT COUNT(*) FROM Jokes_table').fetchone()[0]
    c.execute('SELECT Joke FROM Jokes_table WHERE id={sentenceId}'.\
            format(sentenceId=random.randint(1, numColumns))
            )
    return str(c.fetchone()[0])

print getRandomJoke()

@@ -27,21 +27,8 @@
 e3%0A%0A
-import praw%0A%0A
 def 
@@ -116,22 +116,19 @@
 %0A    num
-Column
+Row
 s = c.ex
@@ -307,14 +307,11 @@
  num
-Column
+Row
 s))%0A

update getRandomJoke