Script code error



Hello here is my breif code, that i am trying to run on the latest version of python

import requests, re, json, time

# Created by Alex Beals
# Last updated: January 29th, 2016

base_url = ''
redirect = ""

def vote_once(form, value):
    c = requests.Session()
    init = c.get(base_url + str(form) + "/", headers=redirect, verify=False)
    # Search for the data-vote JSON object
    data ="data-vote=\"(.*?)\"",init.text).group(1).replace('"','"')
    data = json.loads(data)
    # Search for the hidden form value
    pz ="type='hidden' name='pz' value='(.*?)'",init.text).group(1)
    # Build the GET url to vote
    request = "" + str(data['at']) + "&pt=0&r=0&p=" + str(form) + "&a=" + str(value) + "%2C&o=&t=" + str(data['t']) + "&token=" + str(data['n']) + "&pz=" + str(pz)
    send = c.get(request, headers=redirect, verify=False)
    return ('revoted' in send.url)

def vote(form, value, times):
    global redirect
    redirect = {"Referer": base_url + str(form) + "/", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36", "Upgrade-Insecure-Requests":"1", "Accept-Encoding": "gzip, deflate, sdch", "Accept-Language": "en-US,en;q=0.8"}
    # For each voting attempt
    for i in range(1,times+1):
        b = vote_once(form, value)
        # If successful, print that out, else try waiting for 60 seconds (rate limiting)
        if not b:
            print (time  + str(i) +
            print ('Locked! Sleeping for  6 seconds.')

# Initialize these to the specific form and how often you want to vote
poll_id =9407004
answer_id =42902134
number_of_votes =1000

vote(poll_id, answer_id, number_of_votes)`

though instead i get this error.
Traceback (most recent call last):
File "C:/Users/student/Desktop/", line 43, in
vote(poll_id, answer_id, number_of_votes)
File "C:/Users/student/Desktop/", line 31, in vote
print (time + str(i) +
TypeError: unsupported operand type(s) for +: 'module' and 'str'

please help me i am kinda new to programming



if you use + to join a string, all the items must be strings, time is not a string data type, you could try to use , instead or cast time to a string (there is a string time module:

print(time, str(i), "whatever else"


print(str(time)+ str(i) + "whatever else"


thank you very much it worked.

My kind regards