Answered step by step
Verified Expert Solution
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 ifelse 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 AC
Yes
print A
No
print C
si
No
is BC
Yes
print B
No
print C
si
Given a script, just having either If Ifelse or nested If print the output.
Constraints
number of lines in the script
values that variables hold
Input
The script with any of if ifelse 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
Examples
Example
Input
is AB
Yes
print B
No
print A
si
A B
Output
Explanation
The above script depicts
if A B
printA
if A B
printB
else
printA
Here A and B since B A according to the condition, we print A as output in the first line which is followed by AB by condition executing else block and printing A as output in the second line which is
Example
Input
is A
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started