Tag: Python programs

Python Program to Generate Multiplication Table

In this Python program, you will learn how to use loops in python to generate and display multiplication table of a given number. How to Generate and Display Multiplication Table in Python? Output 8 x 1 = 88 x 2 = 168 x 3 = 248 x 4 = 328 x 5 = 408 x 6 = 488 x 7 = 568 x 8 =…

Python Program to Check if a Number is Positive, Negative or Zero

In this python program, you’l learn how to check for a number of it is a positive , negative or zero. We will be using the conditional statements in python to solve this problem. How to find if a number is positive, negative or zero? Output The number that you entered is a Positive number A number is considered to be positive if it is…

Python Program to display "Hello, World!"

Problem Write a program in Python to display “Hello, World!” on the screen. Python Program to display “Hello, World!” in Console Window. This is a simple Python program that displays “Hello, World!” on the console window. Output Hello, World! The above Python program uses the print() function to display the Hello,World! string to the screen. Note that the strings are enclosed inside the single quotes…

Python – How do list all files of a directory?

In Python ,you can list all files of a directory using the os.listdir(). How do list all files of a directory in Python? You can use the os.listdir() in pythpn which will list all the files that is in the directory includes files and directories. Incase you want just the files , you can filter it using the path function.

Python Program to Print Fibonacci Series

In this Python program, you will learn how to generate and print Fibonacci series using loops and conditional statements. What is a Fibonacci Sequence ? A Fibonacci sequence is an sequence of integers where the value of the sequence is determined by adding the preceding two values. The first two values in the sequence is 0 and 1. Then comes Next one with (N-1) +…