Python-Set-1-Coding-Pratice (1)
Python-Set-1-Coding-Pratice (1)
1. Given a range of first 10 numbers, Iterate from start number to the end number and
print the sum of the current number and previous number.
2. Given a string, display only those characters which are present at an even index
number.
3. Given a string and an integer number n, remove characters from a string starting
from zero up to n and return a new string.
4. Given a list of numbers, return True if first and last number of a list is same.
5. Given a list of numbers, Iterate it and print only those numbers which are divisible of
5.
6. Return the total count of sub-string appears in the given string.
7. Print the following pattern
1
12
123
1234
12345
8. Reverse a given number and return true if it is the same as the original number.
9. Given a two list of numbers create a new list such that new list should contain only odd
numbers from the first list and even numbers from the second list.
10. Write a code to extract each digit from an integer, in the reverse order.
11. Given a list iterate it and display numbers which are divisible by 5 and if you find
number greater than 150 stop the loop iteration.
12. Python program to display all the prime numbers within a range.
13. Use a loop to display elements from a given list which are present at even positions.
14. Find the sum of the series 2 +22 + 222 + 2222 + .. n terms.
15. Given a two list. Create a third list by picking an odd-index element from the first list
and even index elements from second.
16. Given an input list removes the element at index 4 and add it to the 2nd position and
also, at the end of the list.
17. Given a list slice it into a 3 equal chunks and reverse each list.
18. Given a two list of equal size create a set such that it shows the element from both lists
in the pair.
19. Given a string of odd length greater 7, return a string made of the middle three chars
of a given String.
20. Given 2 strings, s1 and s2, create a new string by appending s2 in the middle of s1.
21. Given 2 strings, s1, and s2 return a new string made of the first, middle and last
character of each input string.
22. Arrange string characters such that lowercase letters should come first.
23. Count all lower case, upper case, digits, and special symbols from a given string.
24. Given a string, return the sum and average of the digits that appear in the string,
ignoring all other characters.
25. Print the following pattern.
*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*