Reading Time: 2 minutesRunning Python Scripts Running Python Scripts: Once you have installed Python, you executed Python scripts (.py files) in the following way: For Windows, press Windows + R for the run […]
Month: January 2017
PyPro #36 Removing end-of-line characters from a file
Reading Time: 1 minutesRemoving end-of-line characters from a file in Python Removing end-of-line characters from a file in Python Removing end-of-line characters from a file: Write a Python program to create minified versions […]
PyPro #35 Picking a random line from a file
Reading Time: 1 minutesPicking a random line from a file in Python Picking a random line from a file in Python Picking a random line from a file: Write Python code to pick […]
PyPro # 34 Printing corresponding lines of two files together
Reading Time: 1 minutesPrinting corresponding lines of two files together in Python Printing corresponding lines of two files together in Python Printing corresponding lines of two files together: Write a Python script which […]
PyPro #33 Longest word(s) in a file
Reading Time: 1 minutesLongest word(s) in a file in Python Longest word(s) in a file in Python Longest word(s) in a file: Write a Python program to extract the longest word(s) out of […]
PyPro #32 Emulating the 'head' command of Unix
Reading Time: 1 minutesEmulating the 'head' command of Unix in Python Emulating the 'head' command of Unix in Python Emulating the 'head' command of Unix in Python: In Unix, the head -n fileName […]
Python: Copying a file
Reading Time: 1 minutesCopying a file in Python: You can use either copy() function or copyfile() function of builtin module shutil to create a copy of a file. Copying a file in Python
Python: Getting size of a file on disk
Reading Time: 1 minutesGetting size of a file on disk in Python: Using the stat() function of builtin module os, you can retrieve information about a file on disk, including its size in […]
PyPro #31 nth Term of Fibonacci Series
Reading Time: 1 minutesnth Term of Fibonacci Series in Python: Write a Python function which gives nth term of Fibonacci series. Fibonacci series is a sequence of numbers in which each number is […]
PyPro #30 Computing Factorial of a Number
Reading Time: 1 minutesComputing Factorial of a Number in Python: Compose a factorial() function which accepts an integer and returns its factorial. Factorial (denoted by an exclamation mark !) of a number x […]