Master your skills with these problems
In order to run the solution code, please copy and paste and the program onto the main.py and then run it. It is much more efficient
Check whether an inputted value is odd or even.
Display the number of asterisks(*) according to the input and then display one less than the number of asterisks and the continue like this until the number is 1.
Hint: Try using the range() function
Write a program to switch the upper case letters to lowercase and the lower case letters to upper case and the numbers in a sentence shall remain the same.
Make a simple rock-paper-scissor game.
1. Rock beats scissor
2. Paper beats rock
3. Scissor beats Paper
Hint: Import a module called random
Check whether a entered year is a leap year.
Write a code to print the next 5 leap years from a given year in the input. These 5 leap years should be added to a list. The list should be printed and the elements in the list should also be printed in a new line. The input can be any number, cannot be a float and has to be valid. If the input is a leap year itself, add the input year to the list and the next 4 leap years after the input.
Write a python code to print the next day of the given inputs. All of three inputs are integers and these are a day, month, year. For example, if the day was 4, the month was 9, and the year was 2004. The output should be 5-9-2004. Because the next day after 4 is 5. The day will always be less than 28. Here is the catch, your code shall not exceed one line.
Write a program to remove a specific character from a string. Take two inputs, n and string. n shall be a number and the string should be a string. The output should be the string without the nth character.
Write a program to print the indexes of spaces in a string.
Hint: Try using the function enumerate().
The output doesn't have to be in one line
Write a program to generate the ticket numbers for specified number of passengers traveling in a flight as per the details mentioned below:
The ticket number should be generated as airline:src:dest:number.
Consider AI as the value for airline ,src and dest should be the first three characters of the source and destination cities. number should be auto-generated starting from 101.The program should return the list of ticket numbers of last five passengers.
Note: If passenger count is less than 5, return the list of all generated ticket numbers.
Write a python program to take sentence and print each word in reverse and the join back the sentence.
Write a program that accepts a sentence and calculate the number of letters and digits.
Write a program that counts the number of upper and lower case letters in a given sentence by taking an input by the user.
Write a code to count the number of vowels and consonants in a given string.
Write a Python program to get the Fibonacci series between 0 to 50.