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

You are given two integers, a and b. Print the smallest value among a%b and b%a.




Calculate Double or Triple

Write a program to print the triple of number

N if it is a multiple of 3 otherwise, double of N.Input

The first line is an integer

N.Output

The output should be an integer based on the above conditions.

Explanation

In the given example

N = 3, As 3 is a multiple of 3, we multiply the value by 3. So, the output should be 9.

Sample Input 1

3

Sample Output 1

9

Sample Input 2

4

Sample Output 2

8




Given a list of numbers, write a program to print the smallest positive integer missing in the given numbers.The input will be a single line containing numbers separated by space.Output.The output should be a single line containing the smallest missing number from given numbers.Explanation

For example, if the input numbers are 3, 1, 2, 5, 3, 7, 7.

The number 1, 2, 3 are present. But the number 4 is not. So 4 is the smallest positive integers that is missing from the given numbers.

Sample Input 1

3 1 2 5 3 7 7

Sample Output 1

4

Sample Input 2

5 5 2 3 1 8 8 4

Sample Output 2

6




Sentence Capitalizer

Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is “hello. my name is Joe. what is your name?” the function should return the string “Hello. My name is Joe. What is your name?” The program should let the user enter a string and then pass it to the function. The modified string should be displayed.


Write a python program that reads an integer representing a month of the year, and then print the name of the month. Your program must include validation and error handling code. Thus if the user enters a value outside the range of 1-12 or characters that cannot be converted to an integer, your code must print the appropriate message and continue without crashing.


Hint: you may not use any 'if' statements


When input is "python learning" output displayed is 16-25-20-8-15-14- 12-5-1-18-14-9-14-7 there is additional - after 14 digit. how to rectify this issue?


Given a string, write a program to mirror the characters of the string in alphabetical order to create a secret message.

Note: Mirroring the characters in alphabetical order replacing the letters 'a' with 'z', 'b' with 'y', ... , 'z' with 'a'. You need to mirror both uppercase and lowercase characters. You can ignore mirroring for all characters that are not letters.

abcdefghijklmzyxwvutsrqpon nopqrstuvwxyzmlkjihgfedcbaInput

The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).Output

The output should be a single line containing the secret message. All characters in the output should be in lower case.

Explanation

Sample Input 1

python

Sample Output 1

kbgslm

Sample Input 2

Foundations

Sample Output 2

ulfmwzgrlmh




Day Name - 2

Given the weekday of the first day of the month, determine the day of the week of the given date in that month.

Input

The first line is a string

D. The second line is an integer N.Output

The output should be a string.

Explanation

In the given example,

D = Monday. As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will also be Mondays (A week has 7 days). So the 16th day (N = 16) of the month will be a Tuesday.So, the output should be

Tuesday.

Sample Input 1

Monday

16


Output:

Tuesday


sample Input-2:

Tuesday

17


Output:

Thursday


integers = [int(number) for number in input().split()]

K = int(input())

triplets = []

for i in range(len(integers)):

for j in range(i+1,len(integers)):

for k in range(j+1, len(integers)):

tmp = tuple(sorted([integers[i], integers[j], integers[k]]))

if sum(tmp) == K:

if tmp not in triplets:

triplets.append(tmp)

triplets_tuple = tuple(sorted(triplets))

print(*triplets_tuple, sep='\n')

It should also print if there is no triplets matching it should print

Input:

1 5 6 3 5 11

30

Output:

No Matching Triplets Found




  • For this discussion board you are asked to  
  • Consider what you've learned about Python and Visual Basic
  • Read (or re-read) the readings from this module regarding the high-level languages C++, Java, and C#, and their strengths and weaknesses.  
  • Find at least one online reference source on a different programming language that you can discuss and cite. Pick something that interests you. Examples include JavaScript, PHP, SQL, Haskell, Ruby, and numerous others, some more specialized than others.
  • Based on all that information make an original posting either comparing two or more of the languages, or describing one of them (strengths and weaknesses) in some detail. We're primarily concerned with basic structure/syntax and how they work as procedural and/or object oriented programming languages -- not fine details. Make sure you include citation(s) to the new source(s) of information that you've found. 
LATEST TUTORIALS
APPROVED BY CLIENTS