# 4 Fantastic Beginner Python Programming Challenges to Really Test Your Knowledge

Programming is not all about memorizing syntax and knowing every single function every made at the top of your head. It’s about knowing how to apply a strong base of fundamental knowledge to intricate, complex, logic-based, situations.

Before you get to building apps and advanced software like that, you need to master mind-bending and thought-provoking logic. Logical programs that, after reading them, send you deep in thought and analysis.

The following programs will, for majority of you, do just that. They’ll make you think like you’ve never thought before.

They’re not arduous, but they’re not straightforward or simple either.

Since the purpose of this article is for the reader to try solving these programs themselves, I won’t be giving an in-depth explanation of each solution. Just the solution code at the very end. And remember, a single problem can have many solutions. Mine can look completely different from yours, but in the end, it’s the output that matters. However, it won’t help if you code carelessly. For example, copy and pasting a huge chunk of code whereas a simple for loop can do the job.

# 1. The Star Triangle Pattern

Given an input by the user in the form of a positive integer, the program should print out a triangle-shaped pattern made of the star character (*). The input should be stored in a variable called N. N represents the number of rows in the pattern. The number of stars in each row increases by 2 each time.

For example:

If N = 3

If N = 4

# 2. Sum of Integers in String

Given a sentence or cluster of words, find out if there are any integers inside the string. Print out the total number of integers. If there’s at least 1 integer present, find the sum of all of the integers found and print out the sum.

For example:

If string = “200 plus 500 is equal to”

# 3. FizzBuzz

Cycle through every number from 1 to some number that the user provides as input. (only integers) and print each one onscreen. If the number is divisible by 4, then instead of printing the number itself, print “Fizz”. If the number is divisible by 6, then instead of printing the number itself, print “Buzz”. If the number is divisible by both 4 and 6, print “FizzBuzz”. If the number doesn’t satisfy any of these conditions, simply print the number itself.

For example:

If max = 13

The range would be 1 to 13

# 4. Sum of Two

Create a function called sumOfTwo(a, b, v) with 3 parameters.

a is a list of integers, such as [22, 341, 21, 5, 0, -5].

b is also a list of integers, just like a.

v is a single integer.

The function should check if it is possible to take one number from both list a and b, and add the numbers together to equal the number v.

If there are 2 numbers that can do this, print “True”. Otherwise, print “False”.

For example:

The output would be “True” because 3+ 20 = 23.

# Possible solutions:

## 4. Sum of Two

Happy coding! Stay safe during these times.

Written by

Written by

## Aryaman Kukal

#### tech enthusiast ~ programmer ~ avid writer ~ always curious; rarely express it ~ freshman @ American High ~ “Make it work, make it right, make it fast.” 