triangle

Finding total amount of paths in a triangle grid (iterative without recursion)

Finding total amount of paths in a triangle grid (iterative without recursion) Question: i have a given a triangle grid: Triangle For every point (i,j) with i+j being even: Given recursive function Now i need to write a iterative function that finds all possible paths from (0,0) to the point (2n,0) given that n ∈ …

Total answers: 3

How can I make a triangle of hashes upside-down in python

How can I make a triangle of hashes upside-down in python Question: I have to do a hash triangle using this function: def line(num=int, word=str): if word == "": print("*" * num) else: print(word[0] * num) Here is the code i have: def line(num=int, word=str): if word == "": print("*" * num) else: print(word[0] * …

Total answers: 2

Python How to make a number triangle

Python How to make a number triangle Question: So I’ve recently started learning python and my friend gave me a changllege. How to make a number triangle. So basically, I need to make python let me input a number, for example 5. After I do that, I want python to print 54321 4321 321 21 …

Total answers: 4