Description
0. Complete Assignment 1 and 2.
1. Write a Python program to accept a filename from the user and print the extension of that.
“`
Sample filename : abc.java
Output : java
“`
2. Write a Python program to concatenate all elements in a list into a string and return it.
“`
Sample input : [‘a’, ‘b’, ‘c’, ‘d’]
Output : ‘abcd’
“`
3. Write a Python program which accepts a sequence of comma-separated numbers from user and generate a list and a tuple with those numbers.
“`
Sample data : 3, 5, 7, 23
Output :
List : [‘3’, ‘ 5’, ‘ 7’, ‘ 23’]
Tuple : (‘3’, ‘ 5’, ‘ 7’, ‘ 23’)
“`
4. Write a Python program to print all even numbers from a given numbers list in the same order and stop the printing if any numbers that come after 237 in the sequence.
5. Write a Python function to find all distinct pair of numbers whose product is odd from a sequence of integer values.
6. Solve this problem: https://www.hackerrank.com/challenges/find-secondmaximum-number-in-a-list/
7. Write a recursive function to print all possible strings of length k that can be formed from a set of n characters.
“`
[
{
‘roll-no’: 1211,
‘name’: ‘Ravi’,
‘branch’: ‘CSE’
},
{
‘roll-no’: 202,
‘name’: ‘Abhishek’, ‘branch’: ‘SE’
},
{
‘roll-no’: 1202,
‘name’: ‘Sachin’,
‘branch’: ‘IT’
}
]
“`
9. Solve the following subdomains on hackerrank:
– https://www.hackerrank.com/domains/python/py-introduction
– https://www.hackerrank.com/domains/python/py-basic-data-types
– https://www.hackerrank.com/domains/python/py-strings
– https://www.hackerrank.com/domains/python/py-sets
Reviews
There are no reviews yet.