MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

ALGORITHMS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What will the output be from the following code?print("Hello” + str(2) + “world!")
A
Hello world! Hello world!
B
Hello2world!
C
Hello Hello world! world!
D
SyntaxError
Explanation: 

Detailed explanation-1: -What will be the output of print str[2:] if str = ‘Hello World! ‘? Below code will output: llo World!

Detailed explanation-2: -Expert-Verified Answer The output of the following códe will be hello, world! a = “Hello, World!” a is a variable and a string i.e. Hello World! is assigned to it.

Detailed explanation-3: -Use the “print” function to print the line “Hello, World!". print("Goodbye, World!") print("Hello, World!") test output contains("Hello, World!") success msg(’Great job!’)

Detailed explanation-4: -print(’Hello, world!’) Hello, world! In this program, we have used the built-in print() function to print the string Hello, world!

Detailed explanation-5: -Q 9-What is the output of L[-2] if L = [1, 2, 3]? D-None of the above. Answer : A Explanation 1, Negative: count from the right.

There is 1 question to complete.