Category: Python

Convert floating to binary in Python

In this Python program, we will have a look at “How to convert floating point decimal number to binary number?” Python Program to Convert floating to binary def float_bin(number, places = 3): whole, dec =…

Check whether a number has consecutive 0’s in Python

In this Python Program, we will check if the given number has consecutive 0’s . Python Program to check whether a number has a consecutive 0’s #codeatglance python program def result(N, K): z = toK(N,…

Triangular Matchstick Number In Python

This Python program will help you to print the total number of matchstick that is required to form a pyramid of matchsticks of x floors, where X represents the total number of floors. Python Program…

Legendre\’s Conjecture In Python

This Python program will help you to verify Legendre\’s Conjecture. According to Wikipedia “conjecture is a conclusion or proposition based on incomplete information, for which no proof or disproof has yet been found. Conjectures such…

Check if a string contains all unique characters in Python

This Python Program will help you check “if a string contains all unique characters” Python Program To Check If a string contains all unique characters def isUniqueChars(st): if len(st) > 256: return False char_set =…

Copy odd lines of one file to other in Python

This python program will read the contents of one file and copy the content of the odd line into the new file. Steps to write & execute the program: Open the first file in read…

Shopping cart