0% found this document useful (0 votes)
14 views

1.Lakshya Predictive Lab (1)

The document outlines a series of programming tasks for a Python course, including basic arithmetic operations, data type manipulation, user input processing, and control flow using loops. It emphasizes creating and modifying lists, string manipulation, and finding the largest and smallest numbers in a list. Each task requires code implementation and output demonstration.

Uploaded by

dishasingla113
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

1.Lakshya Predictive Lab (1)

The document outlines a series of programming tasks for a Python course, including basic arithmetic operations, data type manipulation, user input processing, and control flow using loops. It emphasizes creating and modifying lists, string manipulation, and finding the largest and smallest numbers in a list. Each task requires code implementation and output demonstration.

Uploaded by

dishasingla113
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Predictive

Analytics Lab
Submitted By: Submitted To:
Name- Lakshya Sood Dr. Surbhi Saraswat

Course-BTech. CSE
Batch-B3

Sap ID-500108522

• Write a Python program to perform basic arithmetic operations (addition,


subtraction, multiplication, division, and modulus) on two numbers.

• Prompt the user to enter two numbers.


• Perform the arithmetic operations and print the results.

• Use appropriate operators and print formatting for clear output.

Code and Output

• Create variables of different data types (integer, float, string, boolean) and perform basic
operations on them.

• Assign values to variables of different data types.

• Perform arithmetic operations on numeric data types.

• Concatenate strings using the + operator.

• Use logical operators to evaluate boolean expressions.

Code and Output


• Write a program to take user input, process it, and display the result.

• Prompt the user to enter their name.

• Greet the user using their name.

• Calculate and print the user's age based on their birth year.

Code and Output


• Write a program to check if a number is even or odd.

• Prompt the user to enter a number.

• Use the modulus operator to determine if the number is even or odd.

• Print the appropriate message.

Code and Output


• Write a program to print the numbers from 1 to 10 using both for and while loops.

• Use a for loop to iterate through a range of numbers.

• Use a while loop with a counter variable.

Code and Output


• Create a list, access elements, modify elements, and perform list operations.

• Create a list of fruits.

• Access elements using indexing

• Modify elements in the list.

• Add and remove elements from the list.

• Find the length of the list.

• Sort the list in ascending and descending order.

Code and Output


• Manipulate strings using various built-in functions.

• Create a string variable and find the length of the string.

• Convert the string to uppercase and lowercase.

• Check if a substring exists in the string.

• Split the string into a list of words.

Code and Output


• Write a program to find the largest and smallest number in a list.

Code and Output

You might also like