-
Notifications
You must be signed in to change notification settings - Fork 47
/
main.py
43 lines (40 loc) · 1.62 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import basic.fibonacci
import basic.listoperations
import basic.mathematics
import basic.oddeven
def main():
print(
"""
1. Count distinct elements of an array
2. Convert string to upper case
3. Sort a set of strings in ascending alphabetical order
4. Find length of a string without using len()
5. Concatenate two strings without using concatenate function
6. Reverse a string using recursion
7. Sort an array in ascending order without using sort()
8. Find the largest element of the array
9. Find the sum of array elements
10. Find number of elements in the string
11. Find largest of 3 elements
12. Count number of vowels and consonants in a string
13. Swap two given numbers
14. Find nPr i.e permutation for given n and r
15. Find nCr i.e combination for given n and r
16. Multiply two floating point numbers without using '*' operator
17. Find quotient and remainder obtained by dividing two numbers
18. Find average of two given numbers
19. Find matrix addition of two given matrices
20. Find matrix multiplication of two given matrices
21. Sort words in given sentence in lexographic (dictionary) order
22. Calculate time difference between two given time periods
23. Print source code of this file.
24. Find if given number is even
25. Find if given number is odd
26. Find n'th fibonacci number for given n
27. Return fibonacci sequence up to the given number
28. Find all possible sub strings
29. Find if a string contains another string
30. Find length of list by iteration
""")
if __name__ == "__main__":
main()