coderz.py

Keep Coding Keep Cheering!

Python Dictionary

Python Dictionary is used to store the data in a key-value pair format. Python’s dictionary data type can mimic real-world data arrangements where a particular value exists for a particular key. The mutable data structure is what it is. The element Keys and values is used to define the dictionary. Keys must consist of just […]

November 29, 2022 | python | No comments

Remove elements from a Python List

There are three methods to remove elements from a list: Making use of the remove() method Using the pop() method of the list object Using the del operator remove() method: The list includes a built-in method for Python called removes (). Removing the first element that matches the given criteria from the list is helpful. […]

November 27, 2022 | python | No comments

Find the Reverse of a Number

When a number is reversed, the digits are rearranged in reverse order, starting with the last digit, then the second-to-last digit, and so on, with the first digit appearing last. Program Code: Output: Note: also read about Armstrong Number in C++ Follow Me Please follow me to read my latest post on programming and technology if you […]

November 27, 2022 | C++ | No comments

Iterate over a list in Python

In Python, there are several different ways to iterate through a list. Let’s examine every method for iterating over a list in Python and compare their performance. Using For loop: The “for” loop in Python is a way to run a repetitive block of code traversing over a sequence of any kind. For instance, Output: […]

November 26, 2022 | python | No comments

Python Lists

As we have already seen in Data Types in Python that Python Lists are just like dynamically sized arrays, declared in other languages (vector in C++ and ArrayList in Java). Let us take a look at them in a more detailed way. Characteristics of Lists: The list has the following characteristics: The lists are ordered. The list’s […]

November 25, 2022 | python | No comments

String Functions – II

Table of Python String Methods. Function Name  Description capitalize() The string’s first character is changed to an uppercase (capital) letter. casefold() Implements caseless string matching center() Add the requested character to the string as padding. count() Returns the number of occurrences of a substring in the string. encode() Encodes strings with the specified encoding scheme […]

November 24, 2022 | python | No comments

String Functions in Python

Built-in String Functions: Many functions are built into the Python interpreter and are always available. You’ll see a few that work with strings and character data in this lesson: Note: Every string method returns a new string with the modified attributes rather than altering the original string. Following are some of the commonly used string functions: […]

November 24, 2022 | python | No comments

Strings in Python

A Python string is a collection of characters enclosed by single, double, or triple quotes. The string is an immutable sequence data type. The computer does not understand the characters; instead, it stores the manipulated character as a combination of 0’s and 1’s internally. Each character is encoded in either ASCII or Unicode. As a […]

November 23, 2022 | python | No comments

Armstrong Number in C++

What is Armstrong Number? The Armstrong number is a number that is equal to the sum of its digits’ cubes. Armstrong numbers include 0, 1, 153, 370, 371, and 407. Let’s look at why 371 is amrstrong in nature: Approach: The approach is to first count the number of digits (or find the order). Let […]

November 23, 2022 | C++ | No comments

Factorial of a given Number

What is Factorial of a number? The product of all positive descending integers is the factorial of n. n! represents the factorial of n. As an example: 4! is pronounced “4 factorial” in this context, and it is also known as “4 bang” or “4 shriek.” The factorial is typically used in Combinations and Permutations […]

November 23, 2022 | C++ | No comments

Advertisement