Professional Documents
Culture Documents
Data Science Assignment
Data Science Assignment
02-134201-042
BS(CS) – 6B
Lab 01: Introduction to Python IDEs, Data Types, and basic control
statements
Exercise 1
Write a Python program to replace the last element in a list with another list.
Expected output:
Solution:
Exercise 2
Write a Python program to get a string made of the first 2 and the last 2 chars from a given a string. If
the string length is less than 2, return instead of the empty string
Expected output:
Solution:
Exercise 3
Create a python program that takes user input and prints square, square root of that number, number
powered to 3 (num^3).
Expected output:
Solution:
Exercise 4
Write a Python function to get a string made of 6 copies of the last three characters concatenated with
the string. Minimum length of string must be
Expected Output:
Solution: