Skip to content

Instantly share code, notes, and snippets.

View gurpreetsingh00885's full-sized avatar
💻
Coding

Gurpreet Singh gurpreetsingh00885

💻
Coding
View GitHub Profile
#include <iostream>
using namespace std;
int is_prime[65];
long long countSpecialBits(long long L, long long R) {
long long count = 0;
for (long long i = L; i <= R; i++) {
for (int j = 0; j < 64; j++) {
if ((i & (1 << j)) && is_prime[j]) {
count++;
@gurpreetsingh00885
gurpreetsingh00885 / coala_test_run
Created September 24, 2017 16:51
Ran coala on one of my projects. Here's the whole output...
Please enter a value for the setting "use_spaces" (True if spaces are to be used instead of tabs.) needed by SpaceConsistencyBear for section "cli":
True
Executing section cli...
evaluator/admin.py
[ 5]
**** PEP8Bear [Section: cli | Severity: NORMAL] ****
! ! The code does not comply to PEP8.
[----] /home/gurpreet/hsproject/evaluate/evaluator/admin.py
[++++] /home/gurpreet/hsproject/evaluate/evaluator/admin.py
@gurpreetsingh00885
gurpreetsingh00885 / task1_2.py
Created March 26, 2017 18:37
This is the solution to task 1 and 2!
"**** DON't FORGET TO HIT +1 **** It really helps."
import random
def quiz():
no_of_ques=3
name_of_stud=raw_input("Please Enter Your Name: ").upper()
score=0
score2=range(no_of_ques)
for i in range(no_of_ques):
no1,no2,operator=random.randint(1,10),random.randint(1,10),random.choice(["+","-","*"]) #Generating random numbers and an operator.