Loading Events

« All Events

  • This event has passed.

Programming Question

April 24 @ 8:00 am - 5:00 pm

String Programming Question

  • What is the purpose of string indexing in Python?
  • How do you access the first character of a string?
  • How do you access the last character of a string using negative indexing?
  • How do you access the second character of a string?
  • How do you access a character at index 3 in a string?
  • What happens if you try to access an index that is out of range in a string?
  • How do you slice a string to get the substring from index 2 to index 5?
  • How do you slice a string to get the first three characters?
  • How do you slice a string to get the last three characters?
  • How do you slice a string to get every second character?
  • How do you slice a string to get the characters from index 2 to index 7
    with a step of 2?
  • How do you reverse a string using slicing

String Output Qustion

  • What is the output of “Python”[1:4]?
  • What is the output of “Hello World”[::-1]?
  • What is the output of “abcdef”[::2]?
  • What is the output of “abcdefgh”[3:6]?
  • What is the output of “abcdefgh”[-3:]?
  • What is the output of “Python”[2:]?
  • What is the output of “Hello World”[:-3]?
  • What is the output of “abcdefg”[2:5:2]?
  • What is the output of “abcdefg”[::-1]?
  • What is the output of “abcdefgh”[3::2]?
  • What is the output of “Python”[::-2]?
  • What is the output of “Hello World”[-3::-1]?
  • What is the output of “abcdefg”[3::-1]?
  • What is the output of “abcdefgh”[:4]?
  • What is the output of “Python”[-2:]?
  • What is the output of “Hello World”[-3:]?
  • What is the output of “abcdefg”[:-2]?
  • What is the output of “abcdefgh”[2::2]?
  • What is the output of “Python”[:4]?
  • What is the output of “Hello World”[2::2]?
  • What is the output of “abcdefg”[-2:]?
  • What is the output of “abcdefgh”[3:6:-1]?
  • What is the output of “Python”[2:4]?
  • What is the output of “Hello World”[:-2]?
  • What is the output of “abcdefg”[-4:-1]?
  • What is the output of “abcdefgh”[::]?
  • What is the output of “Python”[-4:-1]?
  • What is the output of “Hello World”[::2]?
  • What is the output of “abcdefg”[:-3]?
  • What is the output of “abcdefgh”[1:-1:2]?
  • What is the output of “Python”[1:5:2]?
  • What is the output of “Hello World”[3:7]?
  • What is the output of “abcdefg”[4:1:-1]?
  • What is the output of “abcdefgh”[-5::-1]?
  • What is the output of “Python”[::3]?
  • What is the output of “Hello World”[-4::-2]?
  • What is the output of “abcdefg”[3:6:2]?
  • What is the output of “abcdefgh”[:-4]

Click here Check Answer

Details

Date:
April 24
Time:
8:00 am - 5:00 pm
Event Categories:
,
Event Tags:
, ,

Organizer

cocas

Venue

RevivingIndia
Meena bazar
Patna, 800007 India
+ Google Map
Phone
9716817710
View Venue Website