Pawandeep has Published 44 Articles

How to read CSV file in Python?

pawandeep

pawandeep

Updated on 11-Mar-2021 09:10:51

3K+ Views

A CSV file stands for Comma Separated Values file. It is a plain text file in which data values are separated by commas and hence represent a tabular data in the form of plain text with the help of commas. A CSV file has .csv extension.Here’s how a CSV files ... Read More

How long does it take to learn Python?

pawandeep

pawandeep

Updated on 11-Mar-2021 09:07:26

142 Views

How fast can someone learn or excel in something completely depends on one’s interest in learning, dedication and persistence.Now, how long does it take to learn Python depends on how much do you want to learn.The basics of Python which include functions, loops, conditional statements, datatypes, etc., would take about ... Read More

Is Python a scripting language?

pawandeep

pawandeep

Updated on 11-Mar-2021 09:06:44

4K+ Views

Yes, Python is a scripting language.Scripting language v/s Programming languageThe first question which strikes into the mind is, what is the difference between programming and scripting language. The only difference which exists is that the scripting language does not require any compilation, it is directly interpreted.For example, the programs written ... Read More

How to declare a global variable in Python?

pawandeep

pawandeep

Updated on 11-Mar-2021 09:06:20

4K+ Views

What is a global variable?A global variable is a variable that is declared outside the function but we need to use it inside the function.Example Live Demodef func():    print(a) a=10 func()Output10Here, variable a is global. As it is declared outside the function and can be used inside the function as ... Read More

Write a program to form a cumulative sum list in Python

pawandeep

pawandeep

Updated on 10-Mar-2021 14:26:20

2K+ Views

The cumulative sum till ith element refers to the total sum from 0th to ith element.The program statement is to form a new list from a given list. The ith element in the new list will be the cumulative sum from 0 to ith element in the given list.For example, ... Read More

How to round off a number in Python?

pawandeep

pawandeep

Updated on 10-Mar-2021 14:18:23

657 Views

Python has an inbuilt round() function to round off a number.The round() method in Python takes two parameters −The first one is the number to be rounded off.The second one specifies the number of digits to which the number must be rounded off.Here, the second parameter is optional.If second parameter ... Read More

How to print pattern in Python?

pawandeep

pawandeep

Updated on 10-Mar-2021 14:15:23

1K+ Views

Patterns in Python can be printed using nested for loops. The outer loop is used to iterate through the number of rows whereas the inner loop is used to handle the number of columns. The print statement is modified to form various patterns according to the requirement.The patterns can be ... Read More

How to reverse a number in Python?

pawandeep

pawandeep

Updated on 10-Mar-2021 14:12:28

2K+ Views

Reversing an integer number is an easy task. We may encounter certain scenarios where it will be required to reverse a number.Input: 12345 Output: 54321There are two ways, we can reverse a number −Convert the number into a string, reverse the string and reconvert it into an integerReverse mathematically without ... Read More

How to use for loop in Python?

pawandeep

pawandeep

Updated on 10-Mar-2021 14:09:44

3K+ Views

The for loop in Python is used to iterate over a number of elements or some specific integer range. The elements might be of an array, string or any other iterative object in Python.The for loop is the most frequently used looping statement. Most of the programming questions we encounter ... Read More

How to create a dictionary in Python?

pawandeep

pawandeep

Updated on 10-Mar-2021 14:05:15

1K+ Views

A Dictionary in Python is a type of data structure.It consists of a collection of key-value pairs. Each key in the dictionary is unique. Each unique key in the dictionary is associated to its value. Thus, Dictionary holds key : value pairs.We will be discussing how to create a dictionary ... Read More

Advertisements