Python Tutorial | Learn Python Programming

Python is a versatile and beginner-friendly programming language that has gained immense popularity for its simplicity, readability, and wide range of applications. Whether you’re new to programming or looking to expand your skills, learning Python is an excellent choice. In this comprehensive guide, i’ll provide you with a curated list of resources and tutorials from my website to help you master Python programming from scratch.

Python | Convert .py file into .pyc file

Python, known for its simplicity and readability, allows developers to write code in .py files. These files contain the human-readable source code that is executed by the Python interpreter. However, Python also uses .pyc files, which contain the compiled bytecode. Converting .py files into .pyc format can enhance performance and provide basic code protection. This article will guide you through the process of converting .py files into .pyc files.

Python | Difference Between .py And .pyc Files?

Python is a versatile and powerful programming language that is widely used for various applications, from web development to data analysis. When working with Python, you’ll often encounter two types of files: .py and .pyc. Understanding the difference between these files and their purposes can help you better manage and optimize your Python projects. In this article, we’ll explore what .py and .pyc files are, their differences, and why .pyc files are used.

TCS NQT Coding Question-10: Total Fine Collected by Traffic Police

Problem Statement: Particulate matters are the biggest contributors to New-Delhi pollution. The main reason behind the increase in the concentration of Particulate matters include vehicle emission by applying Odd Even Number concept for all types of vehicles. The vehicles with the odd number last digit in the registration number will be allowed on roads on odd dates and those with even number last digit will on even dates.

Given an integer array A[], contains the last digit of the registration number of n vehicles traveling on date d(a positive integer). The task is to calculate the total fine collected by the traffic police department from the vehicles violating the rules.

Note: For violating the rule, vehicles would be fined as x Rs.

TCS NQT Coding Question-9: Single Digit Sum

Problem Statement: An intelligence team has received reports about some threats. The reports consist of numbers in a mysterious way. There is a number “n” and another number “r”. Those numbers are studied thoroughly, and it is concluded that all digits of the number ‘n’ are summed up and this action is needed to be performed ‘r’ number of times. The resultant should also be a single digit that is yet to be deciphered. The task here is to find the single digit sum of the given number ‘n’ by repeating the same action ‘r’ number of times.
If the value of ‘r’ is 0, print the output as ‘0’.

TCS NQT Coding Question-8: Possible Number of Ways

Problem Statement: An international conference will be held in India. Presidents from all over the world representing their respective countries will be attending the conference. The task is to find the number of ways possible(P) to make the N members sit around the circular table such that the president of India and prime minister of India will always sit next to each other.

TCS NQT Coding Question-7: Number of Red Curtains

Problem Statement: A manufacturing company is manufacturing a new collection of curtains. The curtains are of two colors Red(R) and black (B). The curtains color is represented as a string(string) consisting of R’s and B’s of length N.Then, they are packed (substring) into L number of curtains in each box.The box with the maximum number of ‘Red’ (R) color curtains is labeled. The task here is to find the number of ‘Red’ color curtains in the labeled box.

TCS NQT Coding Question-6: Calculate Price Of The Item

Problem Statement: A Mega mart maintains a pricing format for all its products. A value N(integral code) is printed on each product. When the scanner reads the value code on the item, the product of all the digits in the code is the price of the item. The task here is to design the software such that given the code of any item the price should be computed for that.

TCS NQT Coding Question-4: Airport Security Check

Problem Statement: Airport security team have confiscated several items of the passengers at the security check point. All the items have been dropped into a box (array). Each item possesses a certain amount of risk items [0,1,2]. Here, the risk severity of the items represents an array [] of N number of integral values. The task here is to sort the items based on their levels of risk in the array. The risk values range from 0 to 2

TCS NQT Coding Question-3: Number of Sundays

Problem Statement: Ankit is always excited about sunday. It is favourite day, when he used to play all day And goes to cycling with his group. So every time when the months starts he counts the number of sundays he will get to enjoy. Considering the month can start with any day, be it Sun, Mon…. Or so on. Count the number of Sundays Ankit will get within n number of days.

📢 Need further clarification or have any questions? Let's connect!

Connect 1:1 With Me: Schedule Call


If you have any doubts or would like to discuss anything related to this blog, feel free to reach out to me. I'm here to help! You can schedule a call by clicking on the above given link.
I'm looking forward to hearing from you and assisting you with any inquiries you may have. Your understanding and engagement are important to me!

This will close in 20 seconds