Hand shakes
Input=5
Output=10
Create a list of numbers consisting of your student number
and find any s
pecific number inside the list
,
you can use listsearch or binary
search
this list. Then do a sorting to sort the numbers in this list from
least to greatest.
Keep the
repetitive
numbers as it is.
Riya took part in a maths quiz competition. To win the prize money she has to solve a tricky question at the end.For a given list of integers, write a program where all the integers in a given index range to be added.
She will be given M multiple ranges, where she should print the sum of numbers for each corresponding range.
Note: The limits in the range are both inclusive.
Input
The first line f input is space-separated integers.
The second line of input is a positive integer M denoting the number of index ranges.
The next M lines contain two space-separated integers of the range.
Output
The output should be M lines.
Each line contains an integer that represents the sum for the corresponding ranges.
Sample Input1
1 3 4 5 6
5
3 5
Sample Output1
12
[Please test the sample test cases and send the screenshots].
Create a module series.py containing functions to determine Fibonacci series and Exponential series. Import the module created to make it accessible, and Call the functions of that module with module name . Demonstrate the access of functions in the module created.
Develop a Python application which will accept n non-negative integers and will display the DIVISORS of each number then will determine the COMMON DIVISORS of the input integers.
Sample Output:
How many numbers? 4
Input Number 1: 10
Input Number 2: 50
Input Number 3: 15
Input Number 4: 20
Divisors
10: 1 2 5 10
50: 1 2 5 25 10 50
15: 1 3 5 15
20: 1 2 5 10 20
COMMON Divisors is/are: 15
Develop a Python application which will accept n non-negative integers and will display the DIVISORS of each number then will determine the COMMON DIVISORS of the input integers.
Sample Output:
How many numbers? 4
Input Number 1: 10
Input Number 2: 50
Input Number 3: 15
Input Number 4: 20
Divisors
10: 1 2 5 10
50: 1 2 5 25 10 50
15: 1 3 5 15
20: 1 2 5 10 20
COMMON Divisors is/are: 1 5
I need the code to have an output stated above.
Develop a Python application that will randomly select n integers from 1 to 45 without repetitions.
Sample Output:
How many numbers? 6
6 randomly selected nos.
[33, 13, 24, 22, 38, 34]
I need the code to have an output stated above.
Develop a Python application that will accept two non-negative integers and store them in a list and will append ten additional values equivalent to the sum of the two previous elements of the list.
Sample Output:
First Number: 1
Second Number: 3
[1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322]
I need the code to have an output stated above.
You’re working on a search engine. Watch your back Google!
The given code takes a text and a word as input and passes them to a function called search().
The search() function should return "Word found" if the word is present in the text, or "Word not found", if it’s not.
Sample Input
"This is awesome"
"awesome"
Sample Output
Word found
Develop a Python application that will randomly select n integers from 1 to 45 without repetitions.
Sample Output 1:
How many numbers? 6 6 randomly selected nos. [21, 35, 16, 36, 5, 8]