Python_Basics[1]
Python_Basics[1]
Easy
o Input:
5
o Output:
78.54
(Hint: Use the formula: πr²)
o Input:
0
o Output:
32
(Hint: Use the formula: (C × 9/5) + 32)
Medium
o Input:
[1, 2, 2, 3, 4, 4, 5]
o Output:
[1, 2, 3, 4, 5]
o Input:
"Python Programming"
o Output:
4
o Input:
[12, 45, 67, 23, 89, 90]
o Output:
89
6. Capitalize First Letter of Each Word
Write a Python program to capitalize the first letter of every word in a given sentence.
o Input:
"hello world from python"
o Output:
"Hello World From Python"
7. Reverse a String
Write a Python program to reverse a given string.
o Input:
"Innovation"
o Output:
"noitavonnI"
Hard
8. Palindrome Check
Write a Python program to check if a given string is a palindrome (reads the same forward
and backward).
o Input:
"madam"
o Output:
True
o Input:
20
o Output:
[2, 3, 5, 7, 11, 13, 17, 19]
• Input:
7
• Output:
[0, 1, 1, 2, 3, 5, 8]
• Output:
Found at index 4
• Input:
5
• Output:
120
• Input:
[[1, 2, 3], [4, 5, 6]]
• Output:
[[1, 4], [2, 5], [3, 6]]
• Input:
"Exploration of Python programming"
• Output:
"Exploration"
• Input:
"(())"
• Output:
True
• Input:
"(()"
• Output:
False