Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Raju's Conlang Problem Description As we all know Python was created by Guido van Rossum, a Dutch programmer. Raju a coding enthusiast, is trying to

Raju's Conlang
Problem Description
As we all know Python was created by Guido van Rossum, a Dutch programmer. Raju a coding enthusiast, is trying to become a new Guido van Rossum, by developing a new coding language!
Initially, he started with developing syntaxes, especially the if, if-else and nested if, which are control flow structures and only using comparison operators(>,<,==,!=) along with the print function. He felt that it should deviate from the syntax what already exists in other languages. So he made it like below -
If Syntax in Raju's coding language
is AB
Yes
is A>C
Yes
print A
No
print C
si
No
is B>C
Yes
print B
No
print C
si
Given a script, just having either If, If-else or nested If, print the output.
Constraints
3<= number of lines in the script <=50
1<= values that variables hold <=50
Input
The script with any of if, if-else , nested if will be present in the first few lines.
Second last line has the variables used in the script, separated by space. The variable names will be A to Z.
Last line consists of space separated integers denoting the values of variables mentioned in the above line.
Output
Print the output of the script.
Time Limit (secs)
1
Examples
Example 1
Input
is AB
Yes
print B
No
print A
si
A B
12
Output
1
1
Explanation
The above script depicts -
if (A < B){
print(A)
}
if (A > B){
print(B)
}
else{
print(A)
}
Here A=1 and B=2, since B > A, according to the condition, we print A as output in the first line which is 1, followed by A>B ,by condition executing else block and printing A as output in the second line which is 1.
Example 2
Input
is A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

Students also viewed these Databases questions