Write a single statement that will print the message "first is " followed by the value of first, and then a space, followed by "second = ", followed by the value of second. Print everything on one line and go to a new line after printing

Answer :

Answer:

Statement:

print("first is "+str(first)+"  second = "+str(second)) # It is a python statement where first and second are variable of any type.

Explanation:

  • The above statement is the print statement that prints the value of first and second variables like in the form of "first is" value of the first variable, then space, then "second = b" and then the value of the second variable.
  • The value for the first and the second variable of any type but it convert it into string form with the help of str() function in the print statement.
  • The string of the print statement can be formed by the help '+' operator which adds the string with the value and the other string in print statement in java and python language.

Other Questions