Python Answers

Questions answered by Experts: 5 288

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

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.



Given an integer

N as a starting number and K as input, write a program to print a number pyramid of K rows as shown below.Input

The first line of input is an integer

N. The second line of input is an integer K.Explanation

In the example, the given starting number is

10, and the number of rows in the pyramid is 5.


In a wedding that you are attending, there are some chairs that have digits inscribed at their
backs. The chairs are lined in a row such that they form a string of the digits. Find the
minimum number of sets M that can be formed from these digits such that:
1. The number of digits in each set is one gf more than one.
2. Each set is formed using consecutive digits and no digit can be used more than once.
3. In each set, the number formed using the digits is less than or equal to Y.
LATEST TUTORIALS
APPROVED BY CLIENTS