EOF is an end of file condition. We get this error when we use built-in function input and do not give any data to read. This error is raised in some online IDEs. We can overcome it by using try …
In this article, you can find some frequently asked Python programs for Class 12 with correct answers. Problem #1: Leap Year Write a program to input a year and check whether the year is Leap year or not. Output: Problem …
Are you having the feeling that, ‘I’ve learned everything in Python. Now what next?’ There are a lot of things that you can do after Python. With the advancements in the AI/ML fields with Python, you can dive into that …
Here we’ll see how to find the longest word in the given string. e.g., This is how we can find the longest word in the string.
Python gives us freedom to take the input from the user. The input we take from the user is read as string by default. After giving input we have to press “Enter”. Then only the input() function reads the value …
Python is a general purpose, high level, interpreted language with easy syntax and dynamic semantics. It was created by Van Rossum in 1989. It has an amazing computing power. It is preferred by both beginners and prose alike. It is …
Python has many interesting features one of them are decorators. Decorators are used to define a function inside a function. It is used to add some functionality in a function and then return it. e.g., This is how we use …
Python 2 and python 3 is nothing but two different versions of python. In today’s world most of the people use python 3 as it has better features. But here we’ll see the basic differences between python 2 and python …
In every language, deleting a file is an important task. So here we’ll see how to delete a file in python. We have to import os module to remove a file. In this way we can remove file and directory …
The sort() function sorts the items of the list, by default in increasing order. This is done “in place”, i.e., it does not create a new list. It is used in the following syntax:- e.g., Like reverse(), sort() also performs …