!pip install -U qiskit
!pip install -U qiskit_ibm_provider

from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, transpile
from qiskit_ibm_provider import IBMProvider
from secret import api_key_ibm_q

provider = IBMProvider(token=api_key_ibm_q)

backends = provider.backends()

print(backends)

backend = provider.get_backend('ibm_brisbane')

q = QuantumRegister(1,'q')
c = ClassicalRegister(1,'c')
circuit = QuantumCircuit(q,c)
circuit.h(q)
circuit.measure(q,c)

new_circuit = transpile(circuit, backend)
job = backend.run(new_circuit, shots=1, memory=True)

status = backend.status()
print(status.operational)
print(status.pending_jobs)

res = job.result()
print('Result:', res)