Computer Science, asked by st67215, 5 months ago

uiesti.values()
.42 Consider the String s="CHANDRAYAAN2". Write the statement in Python to implement the
following
(5)
(a) To display the string "CHAND"
(c) To display the last four characters.
(d) To repeat the string 2 times.
(e) To display the output "CADAAN"
(1) To display the substring "CHANDRA" in one line and "YAAN2" in second line.​

Answers

Answered by suhaninagar303
1

Answer:

(a) to the display the sting chand

Answered by nikhilkr4979
3

Answer:

a) string="CHANDARYAAN2"

   s1=slice(5)

   print("slicing string:")

   print(string[s1])

b) string="CHANDARYAAN2"

   s1=slice(8,12)

   print("slicing string:")

   print(string[s1])

Similar questions