



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




We have to make a simple calculator in python programming language in which we can perform simple operations of addition, multiplication, division and subtraction using Anaconda navigator software. We have to follow different rules of these operations and use some conditional statements to achieve our required goal. Flow Chart:
Output :
This code snippet writes a given string to a file called "myfile.txt" and then reads the content back from the file. It calculates and prints the number of characters and words in the content accurately. However, the code attempts to count lines by checking for periods, which is incorrect. To count lines correctly, it should split the content by line breaks ("\n") and count the resulting segments. ------------------------------------------------------------------------------------
In our this question we have to make a class of employees in python in which we have to mention the name, employment number, year of joining and designation of employees. Then we have to add the record of 10 employees and then a function which will calculate the salary of employee by following formula salary=basic +5000*number of years in company.
In conclusion, we have learn the concepts, including function definition and usage, file I/O, string processing, and object-oriented programming principles. Each code addresses specific tasks or problems, illustrating different aspects of Python programming. However, the correctness and efficiency of these codes may need some improvements, as discussed in their respective discussions .