-1

So i have a list of values defined as "line". Instead of putting that large list into my code I want to instead enter "line" to make my code shorter.

import io
import pandas as pd
from bioservices import UniProt
from sqlalchemy import create_engine
u = UniProt(verbose=False)
d = u.search("id: (line))", frmt="tab",
             columns="id,protein names,organism,go(molecular function),go(biological process),go(cellular component),sequence")

Here I simply put it in a parenthesis so the elements of that list can be used as the "id:" in my search but it doesn't seem to recognize it as the list that I defined as "line" and instead is just blank

Chris
  • 26,361
  • 5
  • 21
  • 42
Inan Khan
  • 91
  • 6

1 Answers1

1

First of all, you did not define list. Its not printing anything because the variable list is blank. Second of all, you have to change the format of code in line 6. It should be d = u.search(f"id: {line}", frmt = "tab",.

ReplitUser
  • 87
  • 6