A repository of all I've been learning about Python and Version Control using GitHub
Credits to ChristianLempa on GitHub
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
Emphasis, aka italics, with asterisks or underscores.
Strong emphasis, aka bold, with asterisks or underscores.
Qiskit code for Bernstein Vazirani Algorithm.
def bernstein_vazirani(string):
# Save the length of string
string_length = len(string)
# Make a quantum circuit
qc = QuantumCircuit(string_length+1, string_length)
# Initialize each input qubit to apply a Hadamard gate and output qubit to |->
qc.x(string_length)
qc.h(string_length)
qc.h(range(string_length))
qc.barrier()
# Apply an oracle for the given string
# Note: In Qiskit, numbers are assigned to the bits in a string from right to left
for ii, yesno in enumerate(reversed(string)):
if yesno == "1":
qc.cx(ii, string_length)
qc.barrier()
# Apply Hadamard gates after querying the oracle
qc.h(range(string_length))
qc.barrier()
# Measurement
qc.measure(range(string_length), range(string_length))
return qc
Strikethrough uses two tildes. Scratch this.
BIGGER THAN AND BETTER
LINK NEVER BEFORE
First line with two spaces after it.
And the next line.
- First item
- Second item
- Third item
- Fouth item
🎶 Music
🍔 Eat
👨💻 Code
🛌 Sleep
🔁 Repeat
Link with text: My Email
Inline code
has back-ticks around
it.
Then type print("Hello World")
in the next cell
Check out A KiCAD board he rendered in Blender below:
def mqc_s(quantity):
print("MULTIPLE CHOICE------------------------------------")
for i in range(quantity):
guess = input(multple_choice[i])
check_guess(guess, multiple_choice_Ans[i])
print("-----------------------------------------------")
var s = "JavaScript syntax highlighting";
alert(s);
No language indicated, so no syntax highlighting.
But let's throw in a tag.
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
col1 | col2 | col3 |
col1 | col2 | col3 |
import random
print("-------------Nine Lives Challenge Game-------------")
print("Developed by Manuel Ofosu Copyright@15/12/2022")
print('-----------------------------------------------')
print('-----------------------------------------------')
lives = 9
words = ['pizza', 'fairy', 'teeth', 'shirt',
'otter', 'plane', 'brush', 'horse', 'light']
secret_word = random.choice(words)
clue = list('?????')
heart_symbol = u'\u2764'
guessed_word_correctly = False
# Function to Update clue
def update_clue(guessed_letter, secret_word, clue):
index = 0
while index < len(secret_word):
if guessed_letter == secret_word[index]:
clue[index] = guessed_letter
index = index + 1
# Keep asking the user to guess untill they run out of lives
while lives > 0:
print(clue)
print('lives left: ' + heart_symbol * lives)
guess = input('Guess a letter or the whole word: ')
if guess == secret_word:
guessed_word_correctly = True
break
if guess in secret_word:
update_clue(guess, secret_word, clue)
else:
print('Incorrect. You lose a life')
lives = lives - 1
# Determine if player won or lost
if guessed_word_correctly:
print('You won! The secret word was ' + secret_word)
else:
print('You lost! The secret word was ' + secret_word)
Semester 1 | Semester 2 | Semester 3 |
---|---|---|
100% | 65% | 89% |
100% | 65% | 89% |
100% | 65% | 89% |
100% | 65% | 89% |
100% | 65% | 89% |
[x] Open the cheatsheet website
[x] Navigate to the cheatsheet Repo
[x] Write the post
[ ] Update the website
[ ] Contact the user
:
Here's a sentence with a footnote. 1
Footnotes
-
This is the footnote. ↩