Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 76 of 2109
Python Program to check whether Characters of all string elements are in lexical order or not
Lexical order refers to the order of characters or strings based on their dictionary or alphabetical order. In lexical order, characters are arranged in the same way they would be in a dictionary. The comparison is done based on the numerical values of the characters in their respective character sets such as ASCII or Unicode. In lexical order, characters are compared based on their ASCII or Unicode values from left to right. The character with a lower ASCII or Unicode value comes before the one with a higher value. For example, in ASCII order, 'a' comes before 'b', 'b' ...
Read MoreIntroduction to pyglet library for game development in Python
Pyglet is a powerful library for game development and multimedia applications in Python. It provides an easy-to-use interface for creating games, handling graphics, playing audio, and handling user input. Built on top of OpenGL, it enables high-performance graphics rendering. Let's explore the key components of pyglet for game development ? Installation Install pyglet using pip with the following command ? pip install pyglet Collecting pyglet Downloading pyglet-2.0.7-py3-none-any.whl (841 kB) -------------------------------------- 841.0/841.0 kB 2.0 MB/s eta 0:00:00 Installing collected packages: pyglet Successfully installed pyglet-2.0.7 Note: you ...
Read MorePython program to build flashcard using class in python
Generally, a flashcard is a learning tool that consists of a small card or piece of paper with information printed on one side. These are commonly used to aid in memorization and learning of facts, vocabulary, definitions, equations, or any other type of information that can be presented in a question-and-answer format. With the advancement of technology, flashcards have also been adapted into digital formats, such as mobile apps and online platforms, which provide additional features like multimedia content, spaced repetition algorithms, and progress tracking. There are different approaches available in Python to build flashcards using classes. Let's ...
Read MorePython program to add two octal numbers
An octal number is a number expressed in the base-8 numeral system. It uses digits from 0 to 7. Octal numbers are commonly used in computer science and digital systems, especially when dealing with groups of three bits. In octal notation, each digit represents an increasing power of 8. The rightmost digit represents 8^0 (1), the next digit represents 8^1 (8), the next digit represents 8^2 (64), and so on. For example, the octal number 52 represents the decimal number as follows ? (5 * 8^1) + (2 * 8^0) = (5 * 8) + 2 = ...
Read MorePython program that renders a dictionary from two list with K values
A Dictionary is an unordered collection of data structure which stores the elements as key and value. It is mutable and in other programming languages Dictionaries are also known as associative arrays, hash maps, or hash tables. The key is unique and the values can be a single element or a list of elements with duplicates. A Dictionary can be created using curly braces {} or by using the built-in function dict(). Let's see an example of creating a dictionary in Python ? Example student = { 'name': 'Tutorialspoint', ...
Read MoreProgress Bars in Python
Progress bars in Python are visual indicators that provide feedback on the progress of a task or operation. They are especially useful for long-running processes or iterations where it's helpful to show how much work has been completed and how much is remaining. A progress bar typically consists of a visual representation, such as a horizontal bar or textual display, which dynamically updates to reflect the task's progress. It also includes additional information like completion percentage, estimated time remaining, and relevant status messages. Progress bars serve several important purposes: Visual Feedback − Shows ...
Read MoreProgramming Paradigms in Python
Programming paradigm is a specific approach or style of programming that provides a framework for designing and implementing computer programs. It encompasses a set of principles, concepts, and techniques that guide the development process and the structure of the code. Different paradigms have different ways of solving problems, organizing code, and expressing computations. Python supports multiple programming paradigms, making it a versatile language that allows developers to choose the most appropriate approach for their specific problem. Procedural Programming Procedural programming focuses on dividing a program into a set of procedures or functions. In Python, we can define ...
Read MoreProgram to calculate Dooms Day for a year
The doomsday algorithm is a mathematical method developed by John Horton Conway to determine the day of the week for any given date. It's based on the concept that certain dates within each year always fall on the same day of the week, called the doomsday. The doomsday occurs on the following memorable dates − January 3rd (January 4th in leap years) February 28th (February 29th in leap years) March 7th April 4th May 9th June 6th July 11th August 8th September 5th October 10th November 7th December 12th Algorithm Steps Step 1: Calculate ...
Read MoreUnion Operation of two Strings using Python
The union operation on strings combines two strings while removing duplicate characters. Python provides several approaches to perform string union operations, each with different characteristics and use cases. Using Sets Sets automatically remove duplicate elements, making them ideal for union operations ? def string_union_sets(first, second): set1 = set(first) set2 = set(second) union_result = set1.union(set2) return ''.join(union_result) # Example first = "What" second = "Where" result = string_union_sets(first, second) print(f"Union of '{first}' and '{second}': {result}") Union of ...
Read MoreRemoving the Initial Word from a String Using Python
Removing the first word from a string is a common text processing task in Python. This tutorial covers five effective methods: split(), regular expressions, find(), space delimiter, and partition(). Method 1: Using split() Function The split() method divides the string into a list of words, then we join everything except the first element ? def remove_first_word(string): words = string.split() if len(words) > 1: return ' '.join(words[1:]) else: return ...
Read More