python programming exercises

Python Programming Language Exercises 1. Write a python program to perform input/output of all basic data types.2. Write a python program to enter two numbers and find their sum.3. Write a python program to enter two numbers and perform all arithmetic operations.4.Write a python program to enter length and breadth of a rectangle and find […]

C Language basic programming exercises

C langauge basic programming exercises 1. Write a c language program to perform input/output of all basic data types.2. Write a c language program to enter two numbers and find their sum.3. Write a c language program to enter two numbers and perform all arithmetic operations.4. Write a c language program to enter length and […]

Write a C program to find maximum between three numbers

C PROGRAMMING Write a C program to find maximum between three numbers. C program to find maximum between three numbers CategoriesC programming5 mins readAugust 25, 2017 Write a C program to find maximum between three numbers using ladder if else or nested if. How to find maximum or minimum between three numbers using if else […]

Write a C program to find maximum between two numbers

Q. Write a C program to find maximum between two numbers. #include void main() { //Declare two integers int a,b; //Input the two integers printf(“Enter Integer 1:”); scanf(“%d”,&a); printf(“Enter Integer 2:”); scanf(“%d”,&b); //Use if – else to compare the two integers if( a > b) { printf(“Integer 1 is greater”); } else { printf(“Integer 2 […]

Exceptional Handling

Exceptional Handling Exceptional Handling:  Exception handling is a way to han dle errors or unexpected events that may occur during program execution. In Python, you can use the try and except statements to implement exception handling. Here is an overview of how exception handling works in Python: The try block: In this block, you write […]

File Handling

File Handling File Handling:  File handling is an important aspect of programming in Python, as it allows you to read from and write to files on your computer. In Python, file handling can be done using built-in functions and methods. Here is an overview of the basic file handling operations in Python: Opening a file: […]

Packages  in Python

Packages in Python Packages  in Python:  In Python, a package is a collection of modules. A package is simply a directory that contains one or more Python modules and an optional __init__.py file. The __init__.py file is executed when the package is imported and can contain initialization code for the package. Packages are used to […]

Modules 1

Modules 1 Modules:  In Python, a module is a file that contains Python code, usually with the purpose of defining functions, classes, or variables that can be reused in other programs. A module can be created by creating a new Python file with a .py extension and defining the desired functions, classes, and variables within […]

Scope of Variables

Scope of Variables Scope of Variables:  The scope of a variable refers to the region of a program where the variable is accessible and can be used. In most programming languages, including Python, variables can have either local or global scope. In Python, a variable with local scope is a variable that is defined inside […]

Return  Statement

Return Statement Return  Statement:  In Python, the return statement is used to exit a function and return a value to the caller. Here’s a simple example: def add_numbers(num1, num2): sum = num1 + num2 return sum In this example, the add_numbers function takes two arguments num1 and num2 and returns their sum. The return statement […]