Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

Which method would you use to convert a string to uppercase?

View

What is the output of this code? s = "Hello, World!"; print(s[7:12])

View

Which of the following methods can be used to find a substring within a string?

View

What will be the output of this code? s = "Python"; print(s[1:4])

View

How do you concatenate two strings in Python?

View

What is the result of this expression? "Hello".replace("e", "a")?

View

What will be the output of this code? s = " Hello "; print(s.strip())

View

Which method is used to split a string into a list?

View

What will be the output of this code? s = "Python"; print(s[-1])

View

Which of the following will join a list of strings into a single string?

View

Which method would you use to convert a string to uppercase?

upper()
capitalize()
toupper()
toUpperCase()

What is the output of this code? s = "Hello, World!"; print(s[7:12])

"World"
"Hello"
"Wor"
"orld!"

Which of the following methods can be used to find a substring within a string?

find()
search()
index()
Both a and c

What will be the output of this code? s = "Python"; print(s[1:4])

"Pyt"
"yth"
"ytho"
"Pytho"

How do you concatenate two strings in Python?

s1 + s2
s1.append(s2)
s1.concat(s2)
s1.add(s2)

What is the result of this expression? "Hello".replace("e", "a")?

"Hallo"
"Hello"
"Halla"
"Hell"

What will be the output of this code? s = " Hello "; print(s.strip())

"Hello"
" Hello"
"Hello "
" Hello "

Which method is used to split a string into a list?

split()
list()
slice()
separate()

What will be the output of this code? s = "Python"; print(s[-1])

"P"
"n"
"o"
"Error"

Which of the following will join a list of strings into a single string?

join()
str.join()
list.join()
string.join()