Python String Quiz Part-1

Test your understanding of PYTHON STRING!

Here is a PYTHON STRING QUIZ PART 1. In which 20 questions have been asked from PYTHON STRING. There is no negative marking.

If you have not read the Python String article, read first – Python String

0%
Python String Quiz Part-1

Python String Quiz Part -1

1 / 20

1. What is the output of the following program?

Str = "12345"

print(str.isalpha())

2 / 20

2. What is the output of the following program?

Str = "python3"

print(Str.islapha())

3 / 20

3. What is the output of the following program?

a = 'cyber fauz'

print(len(a))

4 / 20

4. What is the output of the following program?

a = 20

b = 60

print(f"The sum of {a} and {b} is",a+b)

5 / 20

5. String is ..?

6 / 20

6. str = 'python programming'

Output: 'PYTHON PROGRAMMING'

If the output is 'PYTHON PROGRAMMING' Which of the given options is correct?

 

7 / 20

7. What is the output of the following program?

str = "python"

print(str.isalpha())

8 / 20

8. What is the output of the following program?

str1 = "Cyber Fauz"

str2 = "Learning Site"

str3 = str1+str2

print("Cyber" in str3)

9 / 20

9. What is the output of the following program?

a = "python"

b = "PYTHON"

print(a is b)

10 / 20

10. a = "Python Programming"

Output: "Python"

If the output is "Python", then which of the given options is correct?

 

11 / 20

11. What is the output of the following program?

a = "Python is a programming language"

print("is" in a)

12 / 20

12. What is the output of the following program?

str1 = "cyber"

str2 = "fauz"

print(str1[ : ] +str2[0:])

13 / 20

13. What is the output of the following program?

ab = "Python"

cd = "Java"

ef = ab+cd

print(ef)

 

14 / 20

14. Predict the output of the following code?

a = "python programming"

print(a[0:18:2])

15 / 20

15. What is the output of the following program?

num1 = "1"

num2 = "2"

num3 = num1+num2

print(num3)

16 / 20

16. Str = "Python string"

Output: "Python String"

If the output is "Python String", Then which of the given option is correct?

17 / 20

17. What is the output of this code?

name = "cyber fauz"

print(name[0],name[1])

18 / 20

18. What is the output of this code?

name = "cyber fauz"

print(name[0:5])

19 / 20

19. What is the output of the following code?

str = "p"

print(str*3)

20 / 20

20. What is the output of the following code?

a = "Hello, How are you?"

print("Python" not in a)

Related Python Quizzes

Python Variable Quiz

Python Operator Quiz