Vikram Chiluka has Published 288 Articles

How to join list of lists in python?

Vikram Chiluka

Vikram Chiluka

Updated on 19-Sep-2022 10:38:44

23K+ Views

In Python, a list is an ordered sequence that can hold several object types such as integer, character, or float. In this article, we will show you how to join the list of lists(nested lists) using python. Now we see 4 methods to accomplish this task − Using nested ... Read More

How to get first 100 characters of the string in Python?

Vikram Chiluka

Vikram Chiluka

Updated on 19-Sep-2022 10:10:12

4K+ Views

In this article, we will show you how to get the first 100 characters of a string in python. The following are the 4 different methods to accomplish this task − Using While Loop Using For Loop Using Slicing Using slice() Function Assume we have taken an input ... Read More

How to append list to second list (concatenate lists) in Python?

Vikram Chiluka

Vikram Chiluka

Updated on 19-Sep-2022 09:30:17

2K+ Views

In Python, a list is an ordered sequence that can hold several object types such as integer, character, or float. In other programming languages, a list is equivalent to an array. In this article, we are going to append the list to another list(Concatenate Lists) in Python. The following are ... Read More

How does Python generate random numbers?

Vikram Chiluka

Vikram Chiluka

Updated on 19-Sep-2022 08:53:19

403 Views

Python includes a built-in package i.e random module for generating random numbers. In this article, we will show you how to generate random numbers in python using different methods − Using random.seed() method Using random.randrange() method Using random.randint() method Using random.random() Using random.choice() method Using random.uniform() method Method ... Read More

What is PEP8?

Vikram Chiluka

Vikram Chiluka

Updated on 15-Sep-2022 09:33:17

1K+ Views

In this article, we will explain PEP8 and its uses in python. Also, we will see its advantages while coding. What is PEP8? PEP is an abbreviation for Python Enterprise Proposal. Writing code with good logic is a crucial aspect of programming, but many other important elements can affect the ... Read More

What is a default value in Python?

Vikram Chiluka

Vikram Chiluka

Updated on 15-Sep-2022 09:31:51

14K+ Views

The Python language has a different way of representing syntax and default values for function arguments. Default values indicate that if no argument value is given during the function call, the function argument will take that value. The default value is assigned by using the assignment (=) operator of the ... Read More

Name mutable and immutable objects in Python

Vikram Chiluka

Vikram Chiluka

Updated on 15-Sep-2022 09:25:17

477 Views

In this article, we will explain to you the mutable and immutable objects in python. Python considers everything to be an object. A unique id is assigned to it when we instantiate an object. We cannot modify the type of object, but we may change its value. For example, ... Read More

How do map, reduce and filter functions work in Python?

Vikram Chiluka

Vikram Chiluka

Updated on 15-Sep-2022 09:21:53

10K+ Views

In this article, we will show you the Python's map(), filter(), and reduce() functions add a touch of functional programming to the language. All three of these are convenience functions that can be replaced with List Comprehensions or loops but offer a more elegant and concise solution to some problems. ... Read More

Difference between indexing and slicing in Python

Vikram Chiluka

Vikram Chiluka

Updated on 15-Sep-2022 09:05:41

9K+ Views

In this article, we will explain to you the differences between indexing and slicing in python. Indexing and slicing are applicable only to sequence data types. The order in which elements are inserted is preserved in sequence type, allowing us to access its elements via indexing and slicing. To ... Read More

Python Program to Read First n Lines of a File

Vikram Chiluka

Vikram Chiluka

Updated on 18-Aug-2022 09:01:10

14K+ Views

In this article, we will show you how to read and print the first N lines of a text file for the given N value using python. Assume we have taken a text file with the name ExampleTextFile.txt consisting of some random text. We will return the first N lines ... Read More

Advertisements