Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n. g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8) where, g(n) is the sum and f(n) is the largest prime factor of n For example, g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18)=5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3 =66
Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n.
g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8)
where, g(n) is the sum and f(n) is the largest prime factor of n
For example,
g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18)
=5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3
=66
g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8)
where, g(n) is the sum and f(n) is the largest prime factor of n
For example,
g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18)
=5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3
=66
A 10-substring of a number is a substring of its digits that sum up to 10. For example, the 10-substrings of the number 3523014 are: 3523014, 3523014, 3523014, 3523014
A 10-substring of a number is a substring of its digits that sum up to 10.
For example, the 10-substrings of the number 3523014 are:
3523014, 3523014, 3523014, 3523014
Write a python function, find_ten_substring(num_str) which accepts a string and returns the list of 10-substrings of that string.
Handle the possible errors in the code written inside the function.
For example, the 10-substrings of the number 3523014 are:
3523014, 3523014, 3523014, 3523014
Write a python function, find_ten_substring(num_str) which accepts a string and returns the list of 10-substrings of that string.
Handle the possible errors in the code written inside the function.
Represent a small bilingual (English-Swedish) glossary given below as a Python dictionary
{"merry":"god", "christmas":"jul", "and":"och", "happy":"gott", "new":"nytt", "year":"ar"}
and use it to translate your Christmas wishes from English into Swedish.
That is, write a python function translate() that accepts the bilingual dictionary and a list of English words (your Christmas wish) and returns a list of equivalent Swedish words.
and use it to translate your Christmas wishes from English into Swedish.
That is, write a python function translate() that accepts the bilingual dictionary and a list of English words (your Christmas wish) and returns a list of equivalent Swedish words.
Write a python 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
where
- 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
Note: If passenger count is less than 5, return the list of all generated ticket numbers.
Solution:-
https://gist.github.com/newsundram2018/56b3df5125e68b31654c71dd9cc59290
The Metro Bank provides various types of loans such as car loans, business loans and house loans to its account holders. Write a python program to implement the following requirements: Initialize the following variables with appropriate input values:account_number, account_balance, salary, loan_type, loan_amount_expected and customer_emi_expected. The account number should be of 4 digits and its first digit should be 1. The customer should have a minimum balance of Rupees 1 Lakh in the account. If the above rules are valid, determine the eligible loan amount and the EMI that the bank can provide to its customers based on their salary and the loan type they expect to avail. The bank would provide the loan, only if the loan amount and the number of EMI’s requested by the customer is less than or equal to the loan amount and the number of EMI’s decided by the bank respectively. Display appropriate error messages for all invalid data. If all the business rules are satisfied ,then display account number, eligible and requested loan amount and EMI’s. Test your code by providing different values for the input variables.
The Metro Bank provides various types of loans such as car loans, business loans and house loans to its account holders. Write a python program to implement the following requirements:
- Initialize the following variables with appropriate input values:account_number, account_balance, salary, loan_type, loan_amount_expected and customer_emi_expected.
- The account number should be of 4 digits and its first digit should be 1.
- The customer should have a minimum balance of Rupees 1 Lakh in the account.
- If the above rules are valid, determine the eligible loan amount and the EMI that the bank can provide to its customers based on their salary and the loan type they expect to avail.
- The bank would provide the loan, only if the loan amount and the number of EMI’s requested by the customer is less than or equal to the loan amount and the number of EMI’s decided by the bank respectively.
Test your code by providing different values for the input variables.
Subscribe to:
Posts (Atom)
Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below. The input dictionary will contain correct spelling of a word as key and the spelling provided by a contestant as the value.
Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below. The input diction...
-
The Metro Bank provides various types of loans such as car loans, business loans and house loans to its account holders. Write a python pr...
-
Question: FoodCorner home delivers vegetarian and non-vegetarian combos to its customer based on order. A vegetarian combo costs Rs.120 pe...
-
Question: You have x no. of 5 rupee coins and y no. of 1 rupee coins. You want to purchase an item for amount z. The shopkeeper wants you ...