Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Compare Last Three Characters

Write a program to check if the last three characters in the two given strings are the same.

Input

The first and second lines of inputs are strings.

Output

The output should be either True or False.

Explanation

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 "---".

Input

The first and second line of input are strings.

Explanation

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


Challenge Part A 1. Let user input his/her first name dan last name separately. Then combine first name dan last name together. 2. Let user input 2 number. Multiply the numbers dan show the answer. 3. Let user input his/her name dan age. Then show this two in a sentence. 4. Let 3 users to key in their height in decimal place. Then show the highest [ use max ()] among these 3 users dan their average height.


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. 


To fork a process is to create a second exact replica of the given process. i.e., When we fork something.
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

N inputs. Print the numbers that are multiples of 3.Input

The first line of input is an integer

N. The next N lines each contain an integer as input.Explanation

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

N inputs. Print the given inputs until you encounter a multiple of 5.Input

The first line of input is an integer

N. The next N lines each contain an integer as input.Explanation

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.



LATEST TUTORIALS
APPROVED BY CLIENTS