Programming Articles - Page 500 of 3363

How to encode and decode URl in typescript?

Shubham Vora
Updated on 16-Jan-2023 15:20:52

18K+ Views

The URI stands for the uniform resource identifier. The URL is one of the most common URIS. We use the URL (uniform resource locator) to find the web page located on the internet. The web pages also contain resources. In simple terms, URI is a string containing some characters, and we can identify the physical and logical resources on the web using the URI. The URL is a subset of the URI, which stores the document address on the web. Reasons to Encode URI The first question that arises in your mind after reading this tutorial's title is why we ... Read More

How to create objects in TypeScript?

Shubham Vora
Updated on 16-Jan-2023 15:19:07

18K+ Views

The object contains the key-value pairs of its properties, or it can be an instance of the class in TypeScript. The class and its objects are the base of object-oriented programming. So, without an object, OOPS doesn’t exist. Mainly, objects are used to invoke the non-static methods of the class. There are multiple ways to define the objects in TypeScript. We will learn all ways to define objects one by one below. Use The Object Literal Notation to Create Objects The object-literal notation means we can create the object using the two curly braces. By comma separation, we need to ... Read More

How to create the anonymous function in TypeScript?

Shubham Vora
Updated on 17-Jan-2023 11:32:56

6K+ Views

In TypeScript, we can declare the function using the function keyword. It is a block of code that performs some operation, and we can reuse the function code by invoking the function. There are two types of functions. One is a named function, and another is an anonymous function. The name function means we can identify it using the unique identifier, and the identifier doesn’t exist for the anonymous functions. We will talk about anonymous functions in depth in this tutorial. As the word ‘anonymous function’ states, it means a function defined without any name or identifier. We can simply ... Read More

How to create abstract classes in TypeScript?

Shubham Vora
Updated on 16-Jan-2023 15:14:23

1K+ Views

Introduction to Abstraction We wanted readers to get familiar with abstract classes and the requirements of abstract classes before implementing them. The abstraction means hiding. It is used to hide the lower-level code implementation from users and some developers. Furthermore, it is used to show only the required information about the method rather than showing the whole complex implementation of methods. Create Abstract Classes We can use the abstract keyword to define the abstract classes or methods. The abstract classes can contain the normal and abstract types of methods. In the abstract class, we need to implement the functional or ... Read More

For-In Statement with Object in TypeScript

Shubham Vora
Updated on 16-Jan-2023 15:11:47

6K+ Views

In TypeScript, an object contains the properties and their values. We can use the for-in loop statement to iterate through every property of the objects and get its value. This tutorial will teach us to iterate through the object key-value pairs via different examples. Also, we will learn what kind of error we can get while iterating through the object properties and how to fix it quickly. Syntax Users can follow the syntax below to iterate through the iterable object properties using the for-in loop statement. For (var_name in object){ Statements or block to execute; } ... Read More

How to use interface with class in TypeScript?

Shubham Vora
Updated on 16-Jan-2023 18:33:25

2K+ Views

In TypeScript, classes are the template that defines the variables and methods. We can use class templates to create objects, which means the class is the reusable component in object-oriented programming, and we can reuse it by creating its object. We can use the ‘interface’ keyword to define the interfaces in TypeScript. The interface contains the class structure. The interface is similar to abstract classes we define in other programming languages, such as Java and C++. It contains only the declaration of variables with their type and method with its return type and parameter types. Classes define the interface's methods ... Read More

What is the best way to get stock data using Python?

Vikram Chiluka
Updated on 16-Jan-2023 13:44:15

13K+ Views

In this article, we will learn the best way to get stock data using Python. The yfinance Python library will be used to retrieve current and historical stock market price data from Yahoo Finance. Installation of Yahoo Finance(yfinance) One of the best platforms for acquiring Stock market data is Yahoo Finance. Just download the dataset from the Yahoo Finance website and access it using yfinance library and Python programming. You can install yfinance with the help of pip, all you have to do is open up command prompt and type the following command show in syntax: Syntax pip install yfinance ... Read More

What is ** in Python?

Vikram Chiluka
Updated on 16-Jan-2023 12:17:53

2K+ Views

In this article, we will learn about the ** operator in Python. Double Star (**) is an Arithmetic Operator (like +, -, *, **, /, //, %) in Python. Power Operator is another name for it. What Order/Precedence Do Arithmetic Operators Take? The rules for both Arithmetic operators and Mathematical operators are same, which are as follows: exponential is run first, followed by multiplication and division, and then addition and subtraction. Following are the priority orders of arithmetic operators used in decreasing mode − () >> ** >> * >> / >> // >> % >> + >> - ... Read More

What are the uses of the "enumerate()" function on Python?

Vikram Chiluka
Updated on 16-Jan-2023 12:13:33

497 Views

In this article, we will learn about the enumerate() function and what are the uses of the "enumerate()" function in Python. What is enumerate() function? Python's enumerate() function accepts a data collection as a parameter and returns an enumerate object. The enumerate object is returned in key-value pair format. The key is the corresponding index of each item, and the value is the items. Syntax enumerate(iterable, start) Parameters iterable − the data collection that is passed in so that it can be returned as enumerate object is called iterable start − as the name suggests, the starting index ... Read More

What are some projects that I can work on while learning Python?

Vikram Chiluka
Updated on 16-Jan-2023 12:08:58

262 Views

In this article, we will learn some projects that we can work on while learning Python. The finest skill you can master right now is unquestionably Python. Python is a flexible language with many potential uses. Python is a programming language that may be used for data research, machine learning, automation, and web development. Python may be used to work as a freelancer or for major software firms like Google. Very few languages offer both of these possibilities. The best way to learn is to create projects and practice solving issues, thus in this article, we've prepared a list of ... Read More

Advertisements