Logo

Programming-Idioms

History of Idiom 42 > diff from v36 to v37

Edit summary for version 37 by sadasdas:
[Python] whynot

Version 36

2019-11-18, 14:38:21

Version 37

2019-11-18, 14:38:51

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Illustration

Idiom #42 Continue outer loop

Print each item v of list a which in not contained in list b.
For this, write an outer loop to iterate on a and an inner loop to iterate on b.

Illustration
Code
sdfds
Code
import time
import os
import sys
import random



def leaderboard():
    board = open("results.txt", "r")
    boardr = board.read()
    print(boardr)


def write_file():
    space = " "
    newline = "\n"
    collon = ":"
    score = "score = "
    results = open("results.txt", "a")
    results.write(newline)
    results.write(namecheck)
    results.write(collon)
    results.write(space)
    results.write(score)
    results.write(count)
    sys.exit(0)

def userauth():
    global namecheck
    u
Comments bubble
Note that using two loops like this in python is by itself very un-idiomatic. Also one would be wise to define a custom exception to avoid hiding "real" exceptions.
Comments bubble
Note that using two loops like this in python is by itself very un-idiomatic. Also one would be wise to define a custom exception to avoid hiding "real" exceptions.