
Master Python logical programs and data structures for beginners by exploring numbers, strings, recursion, arrays, matrices, patterns, sorting and searching, plus linked lists, stacks, queues, and trees.
Maximize your learning in the Python logical programs and data structures course with organized hands-on lectures, sections, and assignments, using PyCharm or any editor.
Determine if a number is even or odd in Python by inputting an integer, validating it as positive, and using the modulo operator to print the result.
Develop a Python leap year checker that uses the divisible by four rule, with century and 400-year exceptions, to determine if a year is leap.
Develop a Python program that issues a credit card type from a user score: silver (400–600), gold (600–800), platinum (800–850); invalid outside this range, showcasing simplified chained comparisons in PyCharm.
Extract digits from a user number in Python using a while loop. Print each digit on the same line, separated by spaces, using modulus 10 and floor division by 10.
Learn to extract digits from a number by treating input as a string and using a for loop with slicing, printing digits from end and reversing a string.
Learn how to sum digits of a number using a digit extractor with a while loop, or by treating input as a string and summing digits via a for loop.
Learn to sum prime digits in a Python program by checking 2, 3, 5, and 7 from 1 to 9, using a simple while loop, with 67895 yielding 12.
Learn to count digits in a number with Python using methods: measuring input length as a string, and counting digits with a while loop that increments a counter until zero.
Learn to determine a duck number by scanning digits with a digit extractor and a boolean flag, printing 'duck number' or 'not a duck number', assuming no leading zeros.
learn to identify a duck number in python with a single line of code by checking for zero in user input and printing the result.
Reverse a number by extracting digits in a loop and building the result with reverse_num = reverse_num * 10 + digit. For input 12345, output is 54321.
Learn to reverse a number in a single line by a print statement, taking input as a string, and reversing it with slicing.
Create a Python palindrome checker by reversing the digits and comparing to the original number, using input, print, and string slicing, with a temp variable to preserve the original.
Master Fibonacci series generation in Python by printing the first n numbers, starting with 0 and 1, using a for loop and updating two terms.
Explore recursion by implementing the Fibonacci series, starting from base cases zero and one, and use a recursive function to compute and print the first n Fibonacci numbers.
Define a recursive Fibonacci function with an exit condition, compute Fibonacci(n-1) + Fibonacci(n-2), and print the Fibonacci series for a given input in a for loop.
Learn to implement a Python Niven number checker by summing digits and checking divisibility, using a temp variable to preserve the original number; practice with 12 and 18.
Learn to identify two-digit special numbers by extracting digits, computing their sum and product, and checking if the total equals the original number, with examples like 29 and 59.
print prime numbers within a given range using Python, starting from start to end, checking divisibility for each number, and printing primes with a for-else approach.
Determine whether a given number is a perfect number by summing its divisors from 1 to n-1 and verifying the sum equals the number, using a Python checker.
Learn to reverse a string in Python using a for loop with range(length-1, -1, -1) and with slicing [::-1], plus examples like hello and the palindrome Malayalam.
Learn to remove vowels from a string in Python by iterating characters and building a non-vowel output, then compare a loop approach with a regex substitution.
Learn to duplicate every character in a string by iterating over input, appending each character twice to a list, and joining it back to form the final output like AABBCCDD.
Explain counting characters and words in a Python string by iterating each character, incrementing char count, and incrementing word count on spaces, with a practical hello example.
Identify the first occurrence of a given character in a string and report its index, then remove that character by slicing into before and after parts.
Learn to extract and print words with even length from a sentence using Python. Split the sentence by spaces, check word lengths, and print even-length words to the console.
Use a for loop with ord and chr to print the next character for each letter in a word, producing encoded output like qbttxpse and hinting at encoding and cryptography.
learn to check if a string is ordered by turning it into a list, copying it, sorting the copy, and comparing to the original using Python's inbuilt list operations.
Explore recursion by showing how a function calls itself to compute factorials, with a base case at zero to stop and return one.
Learn to compute factorials in Python using recursion, with a factorial function, a base case of one, and user input producing outputs like factorial of five is 120.
Implement a recursive Python function to sum numbers from 1 to N, using a base case of num <= 1 and a recursive call with num-1, demonstrated via user input.
Implement a recursive power function in Python that computes base raised to exponent by calling itself until exponent equals one, then prints the result for user-provided base and exponent.
Compute the sum of even numbers in an array by using a for loop to iterate elements, check if each is even, and add it to the result, then print.
Calculate the sum of positive and negative numbers in an array by iterating through elements, storing positives in p_underscore_result and negatives in n_underscore_result, then print both sums.
Learn two Python methods to reverse an array: using slicing [::-1] and building a reversed list with a for loop that iterates from the end to the start.
Identify mini peaks in an array by comparing each element to its previous and next neighbors in Python, printing 3 and 5 from [1, 3, 2, 5, 4].
Find the minimum and maximum in an array with a single pass by initializing min and max to the first element, then iterating from index one to the end.
Print the last m elements of an array in Python by taking m from user input and using range(length - m, length) to print on one line with spaces.
Learn to count the occurrences of a user-specified number in an array using Python, including looping through the list, comparing elements, and printing the total.
Learn to delete the first occurrence of a user-entered element from an array using slicing, creating a new array that excludes that element, with practical examples.
Create and print a three by three matrix in python by defining a two-dimensional array M1 and printing each row with a simple loop.
Add two matrices with the same dimensions by looping through rows and columns, using a zeroed result matrix, and summing corresponding elements from M1 and M2.
Learn to print the diagonal of a matrix in Python by looping and printing elements where the row index equals the column index, yielding 1, 5, 7.
Learn to determine whether a matrix is a sparse matrix by counting zero elements and comparing to half the total elements, using a for-loop traversal and printing the result.
Learn to swap rows in a matrix by swapping each column's elements between two rows using a temp variable, with user input for the row indices and zero-based indexing.
Learn how to compute the transpose of a matrix by swapping rows and columns. Implement it with nested loops to fill a result matrix with the transposed data.
Check if a matrix is symmetric by transposing and comparing to the original. Use a symmetry flag that turns false on any mismatch, illustrated with a two-by-two example.
Swap columns in a Python matrix program by exchanging elements in two user-specified columns across every row using a temp variable and a for loop, producing the swapped matrix.
Print a right triangle (half pyramid) in Python using nested for loops, with outer loop from 1 to n and inner loop printing 1 to i with spaces.
Shows a second variation of the right triangle pattern by printing the line index as a repeated number on that line, producing i copies of i per row.
Learn to print an inverted right triangle in Python by using a descending outer loop and an inner loop that prints i characters of a chosen symbol, separated by spaces.
Learn two variations of the inverted right triangle pattern in python, printing numbers instead of a symbol and adjusting lines from n down to 1 or 1 up to i.
Implement a mirrored right triangle in Python by using nested for loops and spaces to print lines of asterisks based on user input.
Learn to print a pyramid in python by printing spaces and increasing ascii characters from 'a' for a given number of rows, using the two star num minus two formula.
Apply Python to print a downward pyramid pattern using the formula two times num minus two. Start from num and decrement to zero while adjusting spaces and characters.
Learn to print a right pyramid pattern in Python by dividing the task into two halves using nested for loops, printing asterisks with spaces and newlines.
Create a Python program that prints a sandglass pattern by building two halves with nested for loops, handling spaces and stars based on the input number.
Define an algorithm as a language-indepent, stepwise procedure with defined inputs and outputs that can be implemented in any programming language; the lecture illustrates this with a linear search example.
Master time complexity and big O notation to select best algorithm for large-scale problems, analyzing worst, best, and average cases across inputs, with O(1), O(log n), O(n), O(n^2), and O(2^n).
Explore constant time complexity in Python, where runtime remains O(1) regardless of input, exemplified by array index access, and understand why these algorithms are the fastest.
Explore how an algorithm runs in time proportional to the logarithm of input size, using divide-and-conquer strategies like binary search to halve the search space each step.
Learn how linear time complexity scales with input size, expressed as O(n). See examples like finding min/max values and a linear search using a for loop.
Explain quadratic time complexity, where runtime grows as the square of input size. Use nested for loops and bubble sort to show O(n^2) behavior and why it should be avoided.
Learn how exponential time complexity doubles with input, expressed as O(2^n), and how brute-force algorithms explore permutations, which are expensive and do not scale, used by hackers to attack passwords.
Bubble sort performs multiple passes over an array, compares adjacent elements, and swaps when the first is greater than the second, using two loops and resulting in O(n^2) complexity.
Implement bubble sort in python by creating a sorting directory and file, using nested loops to swap consecutive elements and print the sorted list 3 8 10 20 100 199.
Enhance the bubble sort by shortening the inner loop and stopping when the bubble is formed, exposing a growing sorted tail; learn early stopping in the next lecture.
Implement the first enhancement by limiting the inner loop to numbers minus i minus one, using the sorted left side, preserving the sorted output while improving performance.
Enhance bubble sort by adding an early exit: detect no swaps in a full inner pass and stop the outer loop with a while condition.
Implement the second enhancement to the bubble sort by replacing the external for loop with a while loop driven by a swapped flag, resetting i and swapping only when needed.
Implement a Python selection sort on an array by finding the minimum index with a nested loop, swapping elements, and returning the sorted array.
Explore insertion sort by comparing elements and swapping when left element is greater than right, using loops with i and j on array, yielding O(n^2) time and preparing implementation.
Implement insertion sort in Python by defining insertion_sort(array), iterating from the second element, using a key and shifting larger elements, then placing the key in its correct position.
Traverse an array index by index to find a target, returning true if found and false otherwise; this sequential search is best for small data sets with O(N) worst-case.
Implement a linear search in Python by iterating a list and comparing elements to the key. Return the index when found or -1 when not found, with user input example.
Explore binary search on sorted arrays, halving the search space via the middle index, with iterative and recursive implementations and time complexities such as O(log n) and O(1).
Implement binary search in Python by defining low, high, and mid, looping to compare keys, narrowing the sorted list, returning the index or minus one.
Learn how linked lists store data in nodes with next pointers, enabling dynamic growth and traversal from the head, with singly, doubly, and circular variants.
Implement linked list by creating a node class with data and a next pointer, and a linked list class with head initialized to none, preparing for insert and remove operations.
Implement append at end in a linked list by creating a new node, setting head for an empty list, and traversing to the last node to link the new node.
Learn how to insert a node at the beginning, end, or middle of a list by position, with three variations of insertion covered in this lecture.
Learn to insert a node at the beginning of a linked list by creating a new node, pointing its next to the current head, and updating the head.
Implement a traverse method in a linked list to iterate from the head and print each node's data using a temporary pointer p until none.
Insert a node by position into a linked list, including at the beginning when the position is zero. Traverse to the target position and insert between the relevant nodes.
Learners implement a remove from beginning method in a linked list by updating the head to its next node, removing the first element and triggering Python's garbage collection.
Start at the head and use two pointers, current node and previous node, to reach the last node and detach it by setting previous node.next to none for garbage collection.
Explore time complexity of linked list operations, including insert at the beginning (O(1)) and delete from the beginning (O(1)), as well as insert at end and delete from end (O(N)).
Learn how to reverse a linked list using two pointers, previous and next, iteratively updating links and the head, and verify the reversal with traversal before and after.
Detect loops in a linked list using a slow pointer and a fast pointer, moving one and two nodes until they meet or reach none.
Implement a Python double linked list with previous and next pointers, enabling traversal forward and backward. Learn how to create node and list classes, initialize pointers, and append nodes.
Implement the append method to add a node at the end of a list, handling the first node, using a pointer, and updating the previous pointer for doubly linked lists.
Build a traverse method for a double linked list, starting at the head with a temporary pointer, printing each node's data as you move to next, and handling empty lists.
Implement delete at beginning in a doubly linked list, handling empty, single-node, and multi-node cases by updating head, next, and previous. Test shows 10 removed, leaving 20, 30, 40.
Implement delete at end in a doubly linked list by reaching the last node and detaching it with the node's next update, and handling empty or single-node lists.
---
All source code is available for download
Responsive Instructor - All questions answered within 24 hours
Professional video and audio recordings (check the free previews)
----
Are you a College Student with Python background who is interested in improving your programming skills or overcome the fear of coding , this course is for you.This course is for experienced developers as well.
You will start working on simple programs and move using numeric types
Print Digits in a number
Sum of Digits in a number
Check if a number is palindrome or not
Convert integer to binary and visa versa
Check if a given number is Special and Perfect Number
and More
Work with Strings:
Reverse a String in different ways
Count the words in given text
Find words,Remove Vowels
Find Duplicates,Replace Next Character
and More
Understand Recursion and write programs using it
Write programs using Arrays and Matrices
Sum of positive and negative numbers in a array
Find min and max element in a array
Reverse elements in a array
Check if a given matrix is a sparse matrix
Do Matrix Transpose
Swap Rows and Columns
Work with patterns:
Print Right Triangle
Print Inverted Right Triangle
Mirrored Right Triangle
Understand Time and Space Complexity
Implement Bubble Sort and enhance it
Implement Selection Sort
Implement Linear Search
Implement Binary Search using recursive and non recursive ways
Data Structures:
What are Data Structures
Different Types of Data Structures
Linked Lists:
Create a LinkedList
Insert at the end
Insert at the beginning
Insert in the middle
Delete at different positions
Traverse
Find Nth Node
Check if list has a loop
Reverse a List
Work with Double LinkedList
Stacks:
Create a stack using an array
Create a stack using a List
Push,Pop,Peek
Reverse a String using a stack
Check if symbols are balanced
Queues:
Create a Queue using an Array
Create a Queue using a List
enQueue, deQueue