0% found this document useful (0 votes)
75 views

Programs

The document contains examples of programs to check conditions and perform operations on various data types like numbers, strings, lists, tuples etc. It includes programs to check even-odd, positive-negative, palindrome, data type, divisibility, arithmetic operations, maximum of numbers, sorting, indexing, slicing, string manipulation like length, count, case conversion and more.

Uploaded by

Bharathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Programs

The document contains examples of programs to check conditions and perform operations on various data types like numbers, strings, lists, tuples etc. It includes programs to check even-odd, positive-negative, palindrome, data type, divisibility, arithmetic operations, maximum of numbers, sorting, indexing, slicing, string manipulation like length, count, case conversion and more.

Uploaded by

Bharathi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

WAP to print equal if the both inputs are equal


2. Write a program to check whether the input number is greater than 10 or not if it is greater
than 10 print message as greater and print that number if that number is not greater than 10
print that number
3. Write a program to check whether the given input is 0 or not if 0 print 0
4. Write a program to display hello world if the number greater than 1 and lesser than 5
5. Write a program to check whether the given number divisible by 3 or not if print fizz
6. Write a program to check whether given input is divisible by 3 and 5
7. Write a program to check whether a given input is divisible by 3 or 5
8. Write a program to check whether the given string is palindrome or not if it is a palindrome
string palindrome along with the string if it is not a palindrome print not palindrome
9. Write a program to check whether a number is even or odd if even print even if it is odd
print odd
10. Write a program to check whether a square or rectangle
11. Write a program to check whether a given number is multiple of 5 or not
12. Write a program to check whether the given input number is odd or not
13. Write a program to check whether the given number is positive negative or zero
14. Write a program to check whether the input number is divisible by 3 and 5 if the number
divisible by 3 print fizz if the number divisible by 5 print bizz if it is divisible by both then
print fizzbuzz
15. Write a program to perform arithmetic operation depends on a user choice
16. Write a program to check the maximum of three numbers
17. Write a program to check given number is one digit or two digit or three digit for more than
3 digit
18. Write a program to accept any number from 1-5 and display that number in word form
19. Write a program to check whether the given input character is uppercase lowercase
number or a special symbol
20. Program to check whether the given input alphabet present in a collection or not if it is
present in the collection check whether that alphabet is uppercase or lowercase if it is
uppercase convert it into lowercase and vice versa if the alphabet not present in the
collection print invalid
21. Write a program to check whether the given input character is present in a given string
collection or not if it is present then string collection then check whether the collection
length is even or odd if it is even print even indexed items of that collection if it is our print
odd index item of the collection if the character not present in the collection just bring that
collection
22. [14:39, 11/8/2021] .: Write a program to check whether a given input character is a special
symbol or not if it is a special symbol then print that character three times tells print that
character 5 times
23. [14:40, 11/8/2021] .: Write a program to check length of both string collection equal or not if
it is equal print the connection any one of the collection if it is not equal print both the
collection
24. [14:40, 11/8/2021] .: Write a program to check whether both string collection equal or not if
it is not equal print the both string along with the length of a string if both are equal ignore it
25. [14:40, 11/8/2021] .: Write a program to check whether the given number lies between 1 to
10 if it is true square that number if it is false cube that number
26. To check whether both input variable pointing to same memory location or not if it is true
print last item of the second collection if it is false print the first item of the first collection
along with the memory address
27. Write a program to print the string collection in five times when the length of the string
collection should be ordered and the middle character of the string should be oval and the
first character ASCII value should be even if ASCII value is odd then print the string three
times as print that string
28. Ravi would like to buy a new cello or red pen the cost of the pen should be 10 if the pen
available on the shop he will buy the pen if it is not there he will come out of the shop
29. Write a program to check whether the middle of the item present in the list is string data
type or not if it is string print that list if it is not then print that items
30. Write a program to perform addition and subtraction operation by using list collection if the
number is even perform addition operation if the number is not perform subtraction using
the number 10
31. Write a program to replace the special character with *(star) in the input string.
32. Write a program to check whether the given input number is 0 or not. If it is 0 print ‘ZERO”.
If it is not 0 print that input number.
33. WAP to check whether the given two input number is divisible by 3 and 5. If it is divisible
print “Good Morning”, if it is not print “Good Evening”.
34. WAP to check whether the input character is vowel or not. If it is vowel print ‘VOWEL’ along
with that character, if it is not just print ‘CONSONANT’.
35. WAP to check whether the student is pass or fail. If the student got more than 40 marks
print ‘PASS’ along with that marks, if it is not print ‘FAIL’ along with that marks.
36. WAP to check whether the given input character is upper case or lower case. If the input
character is upper case convert into lower case and vice versa.
37. WAP to check whether the given input number is either positive or negative.
38. WAP to check whether leap year or not. If it is leap year print that year, if it is not print ‘NOT
LEAP YEAR’ along with that year.
39. WAP to check whether the length of the string. If the length of the string is even print ‘Even
Length’, if it is odd print that string.
40. WAP to check whether the given input character present in the collection or not. If it is
present print that collection, if it is not print ‘NOT PRESENT’.
41. WAP for getting Voter Id. If that person age is greater than 18 print ‘ELIGIBLE FOR VOTE’
along with that person name. If it is not print ‘NOT ELIGIBLE FOR VOTE’ along with that
person name and age.
42. WAP to print all the even number present inside the string.
43. WAP to print all the string data present inside an input list if it consists at least one ‘a’ in it.
44. WAP to replace all the space by underscore ‘_’ from the given string.
45. WAP to print square of all the numbers present inside the list.
46. WAP to print all the even number present in the position of odd index from the given list.
47. WAP to find length of the string without using len() function.
48. WAP to length of the list without using len() function.
49. WAP to count number of alphabets present in the string.
50. WAP to count number of uppercase alphabets, lowercase alphabets, numbers and special
symbols present in the string.
51. Input: [1, 3, “LADDU”, 3+8j, 4-17j, {1:2,2:3,3:4},[826,4], 9.45, (112,180)]
52. Output: Integer 1
Integer 3
String LADDU
Complex 3+8j
Complex 4-17j
Set {1:2,2:3,3:4}
List [826,4]
Float 9.45
Tuple (112,180)
53. Input: [1, 3, “LADDU”, 3+8j, 4-17j, {1:2,2:3,3:4},[826,4], 9.45, (112,180)]
Output: Integer 2
Float 1
Complex 2
Boolean 0
String 1
List 1
Tuple 1
Set 0
Dictionary 1
54. WAP to print all the odd numbers present in the even index position inside the string.
55. WAP to print all the odd numbers present in the odd index position inside the list.
56. WAP to print all the even numbers present in the odd index position inside the tuple.
57. WAP to print all the even numbers present in the even index position inside the string.
58. WAP to print all the string items present in the odd position inside in the list.
59. WAP to print all the items present in the string between the range from m to n.
60. WAP to print only string items present in the list in between the range from m to n.
61. WAP to print 3rd multiplication table.
62. Python Program to find Sum of Natural Numbers
63. Python Program to find Sum of Even Numbers
64. Python example to find Sum and Average of Natural Numbers
65. Python example to find Sum of Odd Numbers
66. Python example to find sum of Even and Odd Numbers
67. Python example for ASCII Value of a Single Character
68. Python program to print ASCII Value of Total Characters in a String
69. Python program to Concatenate Strings
70. Python program to Convert String to Uppercase
71. Python program to Convert String to Lowercase
72. Python program to Copy a String
73. Python program to Count Occurrence of a Character in a String
74. Python program to Count Total Characters in a String
75. Python program to Count Total Number of Words in a String
76. Python program to Count Vowels in a String
77. Python program to Count Vowels and Consonants in a String
78. Python program to Count Alphabets Digits and Special Characters in a String
79. Python program to Print First Occurrence of a Character in a String
80. Python program to Print Last Occurrence of a Character in a String
81. Python program to check Palindrome or Not
82. Python program to Print Characters in a String
83. Python program to Replace Blank Space with Hyphen in a String
84. Python program to Replace Characters in a String
85. Python program to Remove Odd Characters in a String
86. Python program to Remove Odd Index Characters in a String
87. Python program to Remove First Occurrence of a Character in a String
88. Python program to Remove Last Occurred Character in a String
89. Python program to Reverse a String
90. Python program to find String Length
91. Python program to find Total Occurrence of a Character in a String
92. Python program to Toggle Characters Case in a String
93. WAP to print square of the number in between the range from m to n which is multiple of 3
94. WAP to print number from range m to m which is divisible by 5
95. WAP to print 3rd multiplication table.
96. WAP to print only string items present in the list in between the range from m to n
97. Write a program to print only string items present in the list in between the range m to n
98. Write a program to print all the items present in the string between the range from m to n
99. Write a program to print all the even numbers present in the odd index position inside the
tuple
100. Write a program to print all the odd numbers present in the odd index position
inside the list
101. Write a program to print all the odd numbers present in the even index position
inside the string
102. Write a program to convert the upper case letter to lowercase letter and lowercase
letter to uppercase letter if the character is number 3 place with the zero if the character is
special symbol replace with * for the given input string
103. Write a program to print all the string values present inside the list if the length of
the string is odd under first character starts with vowel
104. Write a program to perform arithmetic operation depends on user requirement.
105. WAP to check whether both input numbers are even or odd. I both inputs are odd
perform addition operation. If any one of the input is even perform multiplication operation.
106. WAP to check whether length of the string is even or odd. If it is even print that
string 10 times. If it is not print 5 times.
107. List_1=[1,2,5,”HAI”,”Hello”,4+10j] ,

List_2=[3,”GOOD”, “HAVE”,”A”,”NICE”,”DAY”]

108.WAP to check whether the first item of these two lists either integer or not. If it is
integer concatenate these two lists or else print memory address of these two lists.

109.WAP to find digits of the number by using len function. If it is one print ‘One Digit’ along
with that number. If it is Two print ‘Two Digit’ along with that number. If it is three prints ‘Three
Digit’ along with that number. If it is greater than three just print that number.

110. WAP to check whether the given item is present in the third item of the list or not. If it is
present print first item of the list. If it is not print last item of the list.

111.WAP to check given input character is vowel or not. If it is vowel print ascii value of that
character. If it is not print square of that ascii value.

112.WAP to print middle number of the given input number when the given input number is odd. If
it is even print invalid number.
113.WAP to print character of the given input ascii values . If the given input number lays between
from 33 to 126 print the character of respective ascii number. If it is not print invalid number

You might also like