Python program for printing Half Pyramid pattern using numbers

Python program for printing Half Pyramid pattern using numbers

n = int(input("Please enter the number of rows: ")) for num in range(1, n + 1): for i in range(num): print...
Python program for printing Half Pyramid pattern using asterisk symbol

Python program for printing Half Pyramid pattern using asterisk symbol

num_rows = int(input("Please enter the number of rows: ")) m = (2 * num_rows) - 2 for i in range(0, num_rows): for j in range(0,...
Python program to check number is prime or not

Python program to check number is prime or not

num=int(input("Please enter any number: ")) lim=int(num/2)+1 for i in range(2,lim): rem=num%i if rem==0: ...
Python program to print table of any given number

Python program to print table of any given number

num=int(input("Please enter any number: ")) for a in range(1,11): print(num,'x',a,'=',num*a) Output: Please enter any...
Python program to calculate the factorial of a number using while loop

Python program to calculate the factorial of a number using while loop

num=int(input("Enter a number: ")) fact=1 a=1 while(a<=num): fact=fact*a #fact*=a a=a+1 ...
Python program to print all even numbers from m to n using for loop

Python program to print all even numbers from m to n using for loop

lower_limit = int(input("Enter the start of range: ")) upper_limit = int(input("Enter the end of range: ")) for num in range(lower_limit, upper_limit + 1): #...
Python program to print all odd numbers from m to n using for loop

Python program to print all odd numbers from m to n using for loop

lower_limit = int(input("Enter the start of range: ")) upper_limit = int(input("Enter the end of range: ")) for num in range(lower_limit, upper_limit + 1): #...
Python program to print all numbers from m to n using for loop

Python program to print all numbers from m to n using for loop

min_value = int(input("Please Enter the Minimum Value : ")) max_value = int(input("Please Enter the Maximum Value : ")) print("Numbers from {0} to {1} are".format(min_value, max_value)) for i...
Python program to print natural numbers from 1 to n numbers using while loop

Python program to print natural numbers from 1 to n numbers using while loop

num = int(input("Please Enter any Number: ")) i = 1 print("Natural Numbers from 1 to {0} are".format(num)) while (i <= num): print (i, end = ' ') ...

Stay connected

19,697FansLike
2,180FollowersFollow
14,700SubscribersSubscribe
- Advertisement -

Latest article

Python program to display the fibonacci sequence using recursive

Python program to display the fibonacci sequence using recursive

def recursive_fibo(num): if num <= 1: return num else: ...
Python program to find the product of two numbers using recursive

Python program to find the product of two numbers using recursive

def mult_product(x,y): if(x<y): return mult_product(y,x) elif(y!=0): ...
Python program to convert octal to decimal using function

Python program to convert octal to decimal using function

def octal_to_dec(n): # Function which is convert octal to decimal num = n; dec_value = 0; ...