Posts

Showing posts with the label coding

How to search for a string in text files in Python?

Image
  In this article, we are going to see how to search for a particular string in a text file.  Ex:- We have a text file and we want to search a particular string from that file with different methods. Consider we have text file with some text bellow:-  " This is Codin India.  A Coding Platform for programmers   You can learn programming from this portal   We are expert in Python and every day we come with tips and tricks   This Channel is owned by Digamber Jha  "   We can see different method one by one. Lets start with first method. Method 1:-  First We will just find the string is present in the file or not.  If the string found then we will print  the output. Steps for searching:- Open a file. Read the file and store it in a variable. Check the condition using If statement. If the condition is true print "String found" else "String not found". Close the file. Output:- This is simple method for finding the string or text from file but has some limitations

7 best methods for developers to slef-taught programming

  In the modern era, where the technology is so vast, it is not compulsory to attend the particular graduation programs for the student to master any technology. If you have that passion for programming then there are various learning methods and resources available (online and offline both) that can help you to be a  Self-Taught   Programmer or Developer. You can use thes resources to master in any technology without any Syllabus or curriculum barrier. In the journey of a   Self-Taught   Developer or Programmer, there is lots of dedication and consistency required. However, being a self-taught developer doesn't mean to not attend any Degree or to not follow any mentor but it tends that you are not dependant on any particular person or platform to master the development skills. Before moving further, let us take a look at several major benefits for being a self-taught Developer:- Self-Taught Developers are generally more proficient as they are not required to follow any particular

User Defined data structure - Python | codin india

Image
  In computer science, a data structure is a logical way of organizing data in computer memory so that it can be used effectively. A data structure allows data to be added, removed, stored and maintained in a structured manner. Python supports two types of data structures: 1. Non-primitive data types:- Python has list, set, tuples and dictionary as its non-primitive data types which can also be considered its in-built data structures. List Arrays Tuples Dictionaries 2. User-defined data structures:- Data Structures that aren't supported by python but can be programmed to reflect the same functionality using concepts supported by python are user-defined data structures. There are many data structures that can be implemented this way:- Linked List Stack Queue Tree  Graphs Hash map Linked List Data Structure:- A  Linked List  is a linear data structure, in which the elements are not stored at contiguous memory location. The elements in a linked list are linked using pointers. Python c

Text to Speech using python

Image
Text2speech Today's video we are going to create Text to speech using python First of all you have to install pyttsx3 library Pyttsx3- Pypl You can just write pip install pyttsx3 in your cmd or Powershell. It will start installing in your system environment. After installation, open your text editor or IDE. Import libraries Just Import pyttsx3 import pyttsx3 as pt Start engine Now it's time to start engine of pyttsx3 module. engine= pt.init() pt is the alias that we used instead of pyttsx3. we used init() method to initialize pyttsx3 library. Here engine is the variable used to start the engine. say() say() is the pyttsx3 method to say or speek the written text. engine.say("Hello World") by calling the engine.say() method we are going to make our computer able to speek