Temperature Conversion:-
You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales.
Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin.
Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.
Formula to convert from Kelvin K to Celsius C is C = K - 273.
Here "C", "F", "K" represent that the temperature scale is in Celsius, Fahrenheit and Kelvin scales respectively.
The input contains the temperature (a number) and the unit of the temperature scale (C, F, K) without any space.
The output contains temperature in Celsius, Fahrenheit and Kelvin scales in each line in the format similar to input and the value of the temperature is rounded to 2 decimal places.
Largest Palindrome
You are given an integer
The input contains a single integer
The output should be a single integer which is the largest palindrome that is less than the given input.
Given
N = 45.44 is the largest number which is a palindrome that is less than 45.
Write a program to count Vowels and Consonants in string.
Given a string, write a program to return the sum and average of the digits of all numbers that appear in the string, ignoring all other characters.
Given an integer N as a starting number and K as input, write a python program to print a number pyramid of K rows as shown
In the example, the given starting number is
10, and the number of rows in the pyramid is 5.So, the output should be
10
11 12
13 14 15
16 17 18 19
20 21 22 23 24
Build an algorithm to parse and process the dynamic expression based on the dictionary
provided. The expression basically consists of Operators, Variables, and Parentheses.
Parentheses have higher precedence (i.e the subexpression in the parentheses should be
executed first)
Basically, the algorithm should support two operators - AND (concatenates the two variables) &
OR (provides first variable value if it is available. Otherwise, go for the second variable)
The algorithm should parse the given expression and apply the respective dictionary values on
the expression and provides the respective computed results.
INPUTS OUTPUT
Sno Expression Dictionary Expected Results
1 A and B
2 A and C
3 D or B
4 A or B
5 A and B and C {'A':'Hello', 'B': 'World', 'C': 'Buddy'}
6 A and (B or C) {'A':'Hello', 'B': 'World', 'C': 'Buddy'}
7 A and (C or D) {'A':'Hello', 'B': 'World', 'C': 'Buddy'}
8 A and (B or C) and D {'A':'Hello', 'C': 'Buddy', ‘D’: ‘Welcome’}
Numbers To Words Problem
Program to convert a given number to Dollar format
Write code to convert a given number into dollar format. For example, if “1234567” is
given as input, the output should be “one million two hundred thirty-four thousand
five hundred sixty-seven dollars”. Code should be able to provide output up to 1
billion.