Articles on Trending Technologies

Technical articles with clear explanations and examples

How can Tensorflow be used to evaluate both the models on test data using Python?

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 251 Views

TensorFlow is a machine learning framework provided by Google. It is an open-source framework used in conjunction with Python to implement algorithms, deep learning applications, and much more. It is used in research and for production purposes. The 'tensorflow' package can be installed on Windows using the below line of code ? pip install tensorflow Tensor is a data structure used in TensorFlow. It helps connect edges in a flow diagram. This flow diagram is known as the 'Data flow graph'. Tensors are nothing but a multidimensional array or a list. We are using ...

Read More

How can Tensorflow be used to compare the linear model and the Convolutional model using Python?

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 275 Views

TensorFlow is a machine learning framework provided by Google. It is an open-source framework used with Python to implement algorithms, deep learning applications, and much more. It is used in research and production environments. The tensorflow package can be installed on Windows using the below line of code − pip install tensorflow Tensor is a data structure used in TensorFlow that helps connect edges in a flow diagram called the Data Flow Graph. Tensors are multidimensional arrays or lists identified by three main attributes − Rank − The dimensionality of the tensor (number ...

Read More

How can Tensorflow be used to compile and fit the model using Python?

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 310 Views

TensorFlow is a machine learning framework provided by Google. It is an open-source framework used with Python to implement algorithms, deep learning applications, and much more. It is used in research and production environments. TensorFlow has optimization techniques that help perform complicated mathematical operations quickly using NumPy and multi-dimensional arrays called tensors. The framework supports deep neural networks, is highly scalable, and comes with popular datasets. It uses GPU computation and automates resource management. The tensorflow package can be installed on Windows using the following command: pip install tensorflow Model Compilation and Fitting Process ...

Read More

Check if Queue Elements are pairwise consecutive in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 355 Views

A queue contains numbers and we need to check if consecutive pairs of elements are pairwise consecutive (differ by exactly 1). This means we group elements in pairs and verify each pair has consecutive numbers. So, if the input is like que = [3, 4, 6, 7, 8, 9], then the output will be True because pairs (3, 4), (6, 7), and (8, 9) are all consecutive. Algorithm To solve this, we will follow these steps − Create a queue and insert all elements from the given list Extract all elements from queue into a ...

Read More

Check if product of first N natural numbers is divisible by their sum in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 346 Views

Suppose we have a number n. We have to check whether the product of (1*2*...*n) is divisible by (1+2+...+n) or not. So, if the input is like num = 5, then the output will be True as (1*2*3*4*5) = 120 and (1+2+3+4+5) = 15, and 120 is divisible by 15. Mathematical Approach Instead of calculating the actual product and sum, we can use a mathematical property. The product of first n natural numbers is n! (factorial), and the sum is n*(n+1)/2. The key insight is: If num + 1 is prime, then the factorial is ...

Read More

Check if product of digits of a number at even and odd places is equal in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 486 Views

In this problem, we need to check whether the product of digits at odd positions equals the product of digits at even positions in a number. The positions are counted from right to left, starting with position 1. For example, in the number 2364: Odd positions (1st, 3rd): 4, 6 → Product = 4 × 6 = 24 Even positions (2nd, 4th): 3, 2 → Product = 3 × 2 = 6 Let's correct this with a proper example where products are equal ? Algorithm To solve this, we will follow these steps − ...

Read More

Check if product of array containing prime numbers is a perfect square in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 303 Views

Suppose we have an array nums with all prime numbers. We have to check whether the product of all numbers present in nums is a perfect square or not. A perfect square is formed when every prime factor appears an even number of times. Since our array contains only prime numbers, we need to count the frequency of each prime and ensure all frequencies are even. So, if the input is like nums = [3, 3, 7, 7], then the output will be True as product of all elements in nums is 441 which is a perfect square ...

Read More

Check if number is palindrome or not in Octal in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 632 Views

A palindrome is a number that reads the same forwards and backwards. In this problem, we need to check if a given number is a palindrome in its octal representation. If the input number is already in octal format (all digits < 8), we check it directly. If it's in decimal format, we first convert it to octal, then check if the result is a palindrome. For example, if the input is 178, it contains digit 8 which is not valid in octal, so it's treated as decimal. Converting 178 to octal gives 262, which is a palindrome. ...

Read More

Check if one of the numbers is one's complement of the other in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 750 Views

Suppose we have two numbers x and y. We have to check whether one of these two numbers is 1's complement of the other or not. We all know the 1's complement of a binary number is flipping all bits from 0 to 1 or 1 to 0. So, if the input is like x = 9, y = 6, then the output will be True as the binary representations are x = 1001 and y = 0110 which are complement of each other. Algorithm To solve this, we will follow these steps − ...

Read More

Check if number can be displayed using seven segment led in Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 25-Mar-2026 1K+ Views

Suppose we have a number n and a constraint c. We need to check whether n can be displayed using 7-segment displays with at most c LEDs. Each digit requires a different number of LED segments to be illuminated. For example, if the input is n = 315 and c = 17, the output will be True since 315 needs 12 LEDs (3 needs 5, 1 needs 2, 5 needs 5) and we have 17 available. Seven Segment Display LED Count: ...

Read More
Showing 5591–5600 of 61,299 articles
« Prev 1 558 559 560 561 562 6130 Next »
Advertisements