You are given two strings as input. Write a program to print the given two strings in reverse order separated by "---".
The first and second line of input are strings.
In the example, the given strings are
Apple, Banana. So now we have to reverse the order of strings to Banana, Apple and add a separation line between the two strings.So the output should be
Banana
---
Apple
Write a program that reads a single line of input and prints the first two and last two characters of the given input and prints the asterisk character (*) in place of the remaining characters.
For example, if the given string is
message, then the first two and last two characters are me, ge. Now replacing all the remaining characters with * will give the output me***ge.
Given a student has scored
M marks in Maths, P marks in Physics and C marks in Chemistry. Write a program to check if a student is eligible for admission in a professional course based on the following criteria:M >= 35, P >= 35, C >= 35 and total in any of the two subjects >= 90.
The first line is an integer
The output should be a single line containing
Given
M = 50, P = 35, C = 40
Sample Input1:
50
35
40
Sample Output:True
35
35
100
Sample Output:True
Given a student has scored
M marks in Maths, P marks in Physics and C marks in Chemistry. Write a program to check if a student is eligible for admission in a professional course based on the following criteria:Sum of marks in any two subjects >= 100 and M + P + C >= 180.
The first line is an integer
The output should be a single line containing
True if it satisfies the given conditions, False in all other cases.
Sample Input
82
55
45
sample output:True
Sample Input
71
30
70
Sample Output:False
Given an integer number M, N as input. Write a program to print a striped rectangular pattern of M rows and N columns using (+ and -) character.
The first line of input is an integer M.
The second line of input is an integer N.
In the given example the striped rectangular pattern of
7 rows and 5 columns. Therefore, the output should be
+ + + + +
- - - - -
+ + + + +
- - - - -
+ + + + +
- - - - -
+ + + + +
Write a program to print a rectangle pattern of M rows and N columns using the characters as shown below.
The first line of input is an integer
M. The second line of input is an integer N.
In the given example,
3 rows and 10 columns. Therefore, the output should be
+----------+
| |
| |
| |
+--------- +
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
The first line of input is an integer N.
The output should be an integer representing the number of positive integers satisfying the above condition.
In the given example,
11 is not divisible by any number from 2 to 10. It is divisible by only 1, 11.So, the output should be 2.
Sample Input : 12
Sample output: 2
Sample Input: 200
Sample output: 47
Sample Input : 10
Sample output: 1
Write a program to print a rectangle pattern of
The first line of input is an integer
In the given example,
3 rows and 10 columns.
Write a program to print a rectangle pattern of M rows and N columns using the characters as shown below.
In the given example,
3 rows and 10 columns.Therefore, the output should be
+----------+
| |
| |
| |
+----------+
QI: write a full python program to process the orders of a Fashion
shop, the order contains the following information:
1- Name of the person who request an order.
2-Phone number of the person who requested the order.
3- Name of the order
4- Is the order delivery or collect from the fashion shop?
Note: the orders are served according to arrival of the order.