%matplotlib inline
# Importing standard Qiskit libraries and configuring account
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.compiler import transpile, assemble
from qiskit.tools.jupyter import *
from qiskit.visualization import *
# Loading your IBM Q account(s)
provider = IBMQ.load_account()

a = 5

print(a)

import numpy as np
print(np.pi)
print(np.random.randint(10))

from numpy.random import randint
randint(10)

a = -5 # Integers
print(a)
b = 16.001 # Floating point numbers
print(b)
c = 1+3j # Complex numbers
print(c)

list1 = [1,2,3,4] # A list of integers
print(list1)
print(len(list1)) # The number of elements
list2 = [] # Square brackets initialises an empty list
list2.append(10) # Append an element to the end of a list
print(list2)
print(list1[3]) # Accessing an element using square brackets. Indices start from 0
list1.remove(3) # Remove the element 3 
print(list1)

string1 = "Hello, World!" # Single or double quotes
print(string1)
print(string1[6:]) # Strings behave like a list of characters

counts = { # Dictionaries are key-value pairs
    '00': 200,
    '10': 150,
    '01': 200,
    '11': 250
}

counts.keys() # Get all the keys

counts.values() # Get all the values

counts.items()

val = 10 
if (val < 10):
    print("less than 10")
else:
    print('10 or more')

for i in range(0,11,2): # Range creates a list 
    print(i)

for num in [10,5,2,4]:
    print(num)

for key, value in counts.items():
    print(key, value)

def foo(x):
    print(x)
    
foo('hello')
foo(10)

def square(x):
    return x**2

square(4)