[](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fimshakil%2Fpython-sqlite-p
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
using namespace std; | |
void BinaryPrint(int n) | |
{ | |
if(n==0) return; | |
BinaryPrint(n/2); | |
printf("%d", n%2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
// define default capacity of the queue | |
#define SIZE 10 | |
// Class for queue | |
class queue | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def square_items(list_of_number): | |
return [item ** 2 for item in list_of_number] | |
class TestUnitTest(unittest.TestCase): | |
def test_square_items(self): | |
self.assertEqual(square_items([1, 2, 3, 4]), [1, 4, 9, 16]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square_number(list_of_number): | |
""" | |
@param list_of_number: a given list of integer number | |
@return: list of square number | |
>>> square_number([1, 2, 3, 4]) | |
[1, 4, 9, 16] | |
>>> square_number([10, 20, 30]) | |
[100, 400, 900] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square_number(list_of_number): | |
return [num ** 2 for num in list_of_number] | |
def test_square_number(): | |
assert square_number([1, 2, 3, 4, 5]) == [1, 4, 9, 16, 25] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.exceptions import HTTPError | |
from bs4 import BeautifulSoup | |
def scrape_url(url, headers=None): | |
try: | |
page = requests.get(url, headers) | |
page.raise_for_status() | |
except HTTPError as e: |
OlderNewer