Compare Last Three Characters
Write a program to check if the last three characters in the two given strings are the same.
The first and second lines of inputs are strings.
The output should be either True or False.
Given strings are
apple, pimple. In both the strings, the last three characters ple are common. So the output should be
True.
Sample Input 1
apple
pimple
Sample Output 1
True
Sample Input 2
meals
deal
Sample Output 2
False
Print in Reverse Order - 2
You are given two strings as input. Write a program to print the given two strings in reverse order separated by "---".
The first and second line of input are strings.
In the example, the given strings are
Apple, Banana. So now we have to reverse the order of strings to Banana, Apple and add a separation line between the two strings.
So the output should be
Banana
---
Apple
Sample Input 1
Apple
Banana
Sample Output 1
Banana
---
Apple
Sample Input 2
Car
Bike
Sample Output 2
Bike
---
Car
You are given a positive integer N. Your task is to find the number of positive integers K <= N such that K is not divisible by any of the following numbers 2, 3, 4, 5, 6, 7, 8, 9, 10.
non adjacent combination o two words
Now, you’re required to write a Python script for forking existing processes by following this algorithm:
1. start by importing the os (operating systems) Python module.
2.then define two distinct functions, one called child() and another called parent(). Both the child() and the parent() just print out the process identifier(PID).
3 the parent() function, first prints out the PID of the process that we are in before calling the os.fork() method to fork the current running process. This creates a brand new process, which receives its own unique PID. Then call the child() function, which prints out the current PID. This PID, should be different from the original PID that was printed out at the start of the script's execution. This different PID represents a successful forking and a completely new process being created.
You are given
The first line of input is an integer
In the given example, there are
6 inputs. 1, 2, 3, 5, 9, 6. The numbers 3, 9, 6 are multiples of 3.
Out put should be
3
9
6
Sample Input 1
6
1
2
3
5
9
6
Sample Output 1
3
9
6
Sample Input 2
4
1
3
6
8
Sample Output 2
3
6
You are given
The first line of input is an integer
In the given example, there are
6 inputs. 1, 2, 3, 5, 9, 6After
3, we have encountered 5, which is a multiple of 5.So, the output should be
Input: aabbhayy
Output: A2B2H1A1Y2
Note : please solve the above coding problem in python.