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

Assignment

Uploaded by

debghosh1980
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment

Uploaded by

debghosh1980
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Login to gmail account


2. Open new tab
3. Type “Google colab” on search bar
4. Click on “Welcome to Colaboratory”
5. Click on “+New notebook”
6. A notebook will open as ‘Untitled.ipynb’, you can rename it if you wish to, without
changing the extension ‘.ipynb’
7. You can write the code in the cell and execute by triangular button on left side.
8. You can add a new cell by clicking on “+Code”

To import “References_Day1.ipynb”,

1. Open new notebook on Google colab


2. Click on File
3. Click on upload notebook
4. Browse to the location where References_Day1.ipynb is saved
5. Select References_Day1.ipynb and open
===================================================================

Assignment 1:

Take four variables to input your house number, street name, city and pin code as strings.
Concatenating these, display your full address with proper punctuations.
Example: 188, Raja Subodh Chandra Mallick Rd, Kolkata-700032
Find out the position of your city in your full address. Modify your house number.

Assignment 2:

Create a list of eight colours. Sort the list in ascending order and display.
Display the 3rd element and the 2nd last element. Modify the 4th element of the list.
Sort the list in descending order and display. Convert the list into a string and display, with data type.

Assignment 3:

Input a list [‘Red’, 16, 44.06, ‘#$’, ‘(3+4) =7’,10,’Blue’,4.5, -89]. Identify numeric values from the list
and display their sum

Assignment 4:

Input a word ‘23B, ABC road, Kolkata=700012’. Identify digits in the word and compute their sum.

Assignment 5:

Create an array of 10 integers. Print data type of the array. Using for loop, compute sum of the
elements of the array. Append a negative integer to the array and display the array.

Assignment 6:

Create two lists: available_subjects (length 10) and requested_subjects(length 4). If any requested
subject is in available_subjects list, display that subject is available. Otherwise, display the subject is
unavailable.
Assignment 7:

Create a dictionary to store the details of a student: Firstname, Class, Section, Roll, Age. Display Class
and Section of the student. Add a new key Surname to the dictionary with its value. Obtain the
Fullname of the student from Firstname and Surname and add to the dictionary. Remove Firstname
and Surname from the dictionary. Display the keys of the updated dictionary. Display the dictionary.

Assignment 8:

Create an empty list pizza_toppings. Add toppings of user's choice to the list, while (s)he wants.
There is no limit, user can add any number of toppings. When all choices are added to the list, user
input will be "Done". Use a flag that indicates if the pizza contains chilli as one of the toppings. After
all the toppings are added, if the pizza contains chilli as topping, display a message "This pizza is
spicy!!!" If it does not, display a message "This pizza is not so spicy!!!" Display selected toppings.

Assignment 9: Find out the maximum among two numbers using lambda function.

Assignment 10:

Input the matrix: [a 1 0.6 ]


[0.7 b 2 ]
[3 0.25 c ]
Display the elements of the matrix maintaining the shape of the matrix.

You might also like