0% found this document useful (0 votes)
3 views1 page

Lab Task 1

The document outlines a lab task involving the installation of Anaconda IDE, requiring a screenshot as proof. It includes programming exercises such as checking for a key in a dictionary, converting C++ code to Python for calculating net pay, finding the smallest of three numbers, and sorting a list of integers. These tasks aim to enhance Python programming skills.

Uploaded by

vjdimple919
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)
3 views1 page

Lab Task 1

The document outlines a lab task involving the installation of Anaconda IDE, requiring a screenshot as proof. It includes programming exercises such as checking for a key in a dictionary, converting C++ code to Python for calculating net pay, finding the smallest of three numbers, and sorting a list of integers. These tasks aim to enhance Python programming skills.

Uploaded by

vjdimple919
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/ 1

Lab Task

1. After successfully installing the Anaconda IDE, take a screenshot of the Anaconda Navigator
interface or the command line showing Anaconda's version. Submit the screenshot as proof of
installation.
2. Write a Python script to check if a given key already exists in a dictionary.
3. Convert the given C++ code into python:
#include <iostream>
using namespace std;

int main() {

double basicPay, houseRent, netPay;

cout << "Enter the basic pay: ";


cin >> basicPay;

// Calculate house rent based on the basic pay


if (basicPay < 30000)
{
houseRent = 0.30 * basicPay;
}
else if (basicPay >= 30000 && basicPay <= 50000)
{
houseRent = 0.40 * basicPay;
}
else
{
houseRent = 0.50 * basicPay;
}
netPay = basicPay + houseRent;

cout << "Basic Pay: " << basicPay << endl;


cout << "House Rent: " << houseRent << endl;
cout << "Net Pay: " << netPay << endl;

return 0;}
4. Write a program that reads three numbers and prints the smallest one.
5. Write a program that reads a list of integers and sort them in ascending order.

You might also like