#program to draw a text-based graph of a mathematical function f(x)
#Kiran Desraj - DSRKIR001
#12 April 2014


import math 
#create empty list which will be used to keep y-values 
ordinate = []
function = input("Enter a function f(x):\n")  

 
for a in range(-10,11):   #axis limits of -10 to 10
    
    c = ''  #Variable created to compute graph
    
    for b in function:       #determine function values
        if( b == 'x'):
            c = c +'('+str(a)+')'
        else:
            c = c + b
            
    ordinate.append(eval(c))

for a in range(10,-11,-1):   #to graphically plot function
    for b in range(-10,11):
        if(round(ordinate[b+10])==a):
            print('o',end='')
        elif(a==0 and b!=0):
            print('-',end='')
        elif(b==0 and a!=0):
            print('|',end='')
        elif(a==0 and b==0):
            print('+',end='')           
        
        else:
            print(' ',end='')
    print()   
750c237a19d753c73c1ea2398a2ba3e4d67a6383
<mask token>

<mask token>
for a in range(-10, 11):
    c = ''
    for b in function:
        if b == 'x':
            c = c + '(' + str(a) + ')'
        else:
            c = c + b
    ordinate.append(eval(c))
for a in range(10, -11, -1):
    for b in range(-10, 11):
        if round(ordinate[b + 10]) == a:
            print('o', end='')
        elif a == 0 and b != 0:
            print('-', end='')
        elif b == 0 and a != 0:
            print('|', end='')
        elif a == 0 and b == 0:
            print('+', end='')
        else:
            print(' ', end='')
    print()

<mask token>
ordinate = []
function = input('Enter a function f(x):\n')
for a in range(-10, 11):
    c = ''
    for b in function:
        if b == 'x':
            c = c + '(' + str(a) + ')'
        else:
            c = c + b
    ordinate.append(eval(c))
for a in range(10, -11, -1):
    for b in range(-10, 11):
        if round(ordinate[b + 10]) == a:
            print('o', end='')
        elif a == 0 and b != 0:
            print('-', end='')
        elif b == 0 and a != 0:
            print('|', end='')
        elif a == 0 and b == 0:
            print('+', end='')
        else:
            print(' ', end='')
    print()

import math
ordinate = []
function = input('Enter a function f(x):\n')
for a in range(-10, 11):
    c = ''
    for b in function:
        if b == 'x':
            c = c + '(' + str(a) + ')'
        else:
            c = c + b
    ordinate.append(eval(c))
for a in range(10, -11, -1):
    for b in range(-10, 11):
        if round(ordinate[b + 10]) == a:
            print('o', end='')
        elif a == 0 and b != 0:
            print('-', end='')
        elif b == 0 and a != 0:
            print('|', end='')
        elif a == 0 and b == 0:
            print('+', end='')
        else:
            print(' ', end='')
    print()

#program to draw a text-based graph of a mathematical function f(x)
#Kiran Desraj - DSRKIR001
#12 April 2014


import math 
#create empty list which will be used to keep y-values 
ordinate = []
function = input("Enter a function f(x):\n")  

 
for a in range(-10,11):   #axis limits of -10 to 10
    
    c = ''  #Variable created to compute graph
    
    for b in function:       #determine function values
        if( b == 'x'):
            c = c +'('+str(a)+')'
        else:
            c = c + b
            
    ordinate.append(eval(c))

for a in range(10,-11,-1):   #to graphically plot function
    for b in range(-10,11):
        if(round(ordinate[b+10])==a):
            print('o',end='')
        elif(a==0 and b!=0):
            print('-',end='')
        elif(b==0 and a!=0):
            print('|',end='')
        elif(a==0 and b==0):
            print('+',end='')           
        
        else:
            print(' ',end='')
    print()   