MedVision ad

Search results

  1. E

    The Code Marathon.

    PYTHON 3 Does not output as a nice looking triangle though. number = int(input("Enter n rows: ")) triangle = [[1],[1,1]] if number == 1: del triangle[-1] number = number - 2 current = 1 for x in range(1, number+1): row = [1] for y in range(current)...
  2. E

    The Code Marathon.

    PYTHON 3 word = list(input("Input word: ").lower()) letters = {} character = "" phrase = "" if "".join(word) == "".join(word[::-1]): print("".join(word),"is a palindrome.") else: odd = 0 for x in word: if x not in letters: letters[x] = 1 else: letters[x] += 1 for x in letters...
  3. E

    The Code Marathon.

    PYTHON 3 Case does not matter in this answer import itertools import sys word = list(input("Input word: ").lower()) if "".join(word) == "".join(word[::-1]): print("".join(word),"is a palindrome.") sys.exit() else: arrange = itertools.permutations(word, len(word)) for x in arrange: if...
Top