from qiskit import IBMQ

IBMQ.providers()
#https://quantum-computing.ibm.com/
#Craete account on IBM from above link and Paste 'YOUR-IBM-API-TOKEN'
IBMQ.save_account('YOUR-IBM-API-TOKEN',overwrite=True)

IBMQ.load_account()

from qiskit import(
  QuantumCircuit,
  execute,
  Aer)
from qiskit.visualization import plot_histogram

# Use Aer's qasm_simulator
simulator = Aer.get_backend('qasm_simulator')

# Create a Quantum Circuit acting on the q register
circuit = QuantumCircuit(2, 2)

# Add a H gate on qubit 0
circuit.h(0)

# Add a CX (CNOT) gate on control qubit 0 and target qubit 1
circuit.cx(0, 1)

# Map the quantum measurement to the classical bits
circuit.measure([0,1], [0,1])

# Execute the circuit on the qasm simulator
job = execute(circuit, simulator, shots=1000)

# Grab results from the job
result = job.result()

# Returns counts
counts = result.get_counts(circuit)
print("\nTotal count for 00 and 11 are:",counts)

# Draw the circuit
circuit.draw(output='mpl')

provider = IBMQ.get_provider('ibm-q')

provider.backends()

qcomp = provider.get_backend('ibmq_lima')

job = execute(circuit, backend=qcomp)

from qiskit.tools.monitor import job_monitor

job_monitor(job)

result = job.result()

plot_histogram(result.get_counts(circuit))