Computer Science, asked by amalmakkar8262, 4 months ago

p="Hello" print (p + "world" print (p*3)

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Corrected C∅de:

p = "Hello"

print(p+"world")

print(p*3)

To Find:

  • The output of the given c∅de (Language: Python)

Output:

Helloworld

HelloHelloHello

Explanation:

  • Here, p is a string. p = "Hello". In the second line, it's written - print(p+"world"). Here, + operator concatenates two strings and so, the string becomes - "Helloworld". Output: Helloworld.
  • In the last line, it's written - print(p*3). Whenever any string is multiplied with any integer value, say n, then the string is repeated n times. Here, p is multiplied by 3. So, p repeats 3 times. Output: HelloHelloHello.

Refer to the attachment.

•••♪

Attachments:
Similar questions