• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 6 pages
Exam (elaborations)

Python Exam Questions (1-65) , PART 1

Document preview thumbnail
Preview 2 out of 6 pages

Python Exam Questions (1-65), PART 1 Latest Update. 1. Which of the following data types are supported in Python? - CORRECT ANSWER The following data type are *Supported*: 1 - Numbers 2 - String 3 - List 4 - Tuples 5 - Dictionary 2. Which of the following data types are *not* supported in Python? - CORRECT ANSWER Slice 3. What is the output of print(str) if str = 'Hello World!'? - CORRECT ANSWER Hello World! 4. What is the output of print(str[0]) if str = 'Hello World!'? - CORRECT ANSWER H 5. What is the output of print(str[2:5]) if str = 'Hello World!'? - CORRECT ANSWER llo 6. What is the output of print(str[2:]) if str = 'Hello World!'? - CORRECT ANSWER llo World! 7. What is the output of print(str * 2) if str = 'Hello World!'? - CORRECT ANSWER Hello World!Hello World! 8. What is the output of print(list) if list=[ 'abcd', 786 , 2.23]? - CORRECT ANSWER ['abcd', 786 , 2.23] 9. What is the output of print(list[0]) if list =[ 'abcd', 786 , 2.23]? - CORRECT ANSWER abcd 10. What is the output of print(list[1:3]) if list=[ 'abcd', 786 , 2.23]? - CORRECT ANSWER [786, 2.23] 11. What is the output of print(list[2:]) if list=[ 'abcd',786, 2.23]? - CORRECT ANSWER [2.23] 12. What is the output of print (tinylist * 2) if tinylist = [123, 'john']? - CORRECT ANSWER [123, 'john',123, 'john'] 13. Which of the following is correct about tuples in Python? - CORRECT ANSWER *** 14. What is the output of print(myTuple) if myTuple = ('abcd',786,2.23)? - CORRECT ANSWER ('abcd',786,2.23) 15. What is the output of print(myTuple[1:3]) if myTuple=('abcd',786,2.23)? - CORRECT ANSWER (786, 2.23) 16. What is the output of print (myTuple[0]) if myTuple = ('abcd',786,2.23)? - CORRECT ANSWER abcd 17. Which function obtains all the keys from a dictionary? - CORRECT ANSWER keys() 18. Which function obtains all the values from a dictionary? - CORRECT ANSWER values() 19. Which function converts a string to an int ? - CORRECT ANSWER int("string") 20. Which function converts a string to a float ? - CORRECT ANSWER float("string") 21. Which function converts a string to a tuple ? - CORRECT ANSWER tuple("string") 22. Which function converts a string to a list ? - CORRECT ANSWER list("string") 23. Which function converts a sequence of tuples to dictionary ? - CORRECT ANSWER dict() 24. Which function converts an integer to a character ? - CORRECT ANSWER chr() 25. Which function converts an integer to an unicode character ? - CORRECT ANSWER unichr() 26. Which function converts a single character to its integer value ? - CORRECT ANSWER ord() 27. Which function converts an integer to hexadecimal string ? - CORRECT ANSWER hex() 28. Which operator performs exponential power calculation on operands? - CORRECT ANSWER ** 29. Which operator performs the division where the result an integer? - CORRECT ANSWER // 30. Which operator evaluates True when operands refer to the same object? - CORRECT ANSWER == or is 31. Which operator evaluates True if it does not find a variable sequence? - CORRECT ANSWER not in 32. Which statement stops and transfers to the statement after the loop? - CORRECT ANSWER break 33. Which statement skips the loop & retests prior to reiterating? - CORRECT ANSWER continue 34. Which statement is used when when you do not want any code to execute? - CORRECT ANSWER exit() or pass() 35. Which function returns a random item from a list, tuple, or string? - CORRECT ANSWER e()

Content preview

Python Exam Questions (1-65), PART 1
Latest Update.

1. Which of the following data types are supported in Python? - CORRECT ANSWER The following data
type are *Supported*:

1 - Numbers

2 - String

3 - List

4 - Tuples

5 - Dictionary



2. Which of the following data types are *not* supported in Python? - CORRECT ANSWER Slice



3. What is the output of print(str) if str = 'Hello World!'? - CORRECT ANSWER Hello World!



4. What is the output of print(str[0]) if str = 'Hello World!'? - CORRECT ANSWER H



5. What is the output of print(str[2:5]) if str = 'Hello World!'? - CORRECT ANSWER llo



6. What is the output of print(str[2:]) if str = 'Hello World!'? - CORRECT ANSWER llo World!



7. What is the output of print(str * 2) if str = 'Hello World!'? - CORRECT ANSWER Hello World!Hello
World!



8. What is the output of print(list) if list=[ 'abcd', 786 , 2.23]? - CORRECT ANSWER ['abcd', 786 , 2.23]



9. What is the output of print(list[0]) if list =[ 'abcd', 786 , 2.23]? - CORRECT ANSWER abcd

, 10. What is the output of print(list[1:3]) if list=[ 'abcd', 786 , 2.23]? - CORRECT ANSWER [786, 2.23]



11. What is the output of print(list[2:]) if list=[ 'abcd',786, 2.23]? - CORRECT ANSWER [2.23]



12. What is the output of print (tinylist * 2) if tinylist = [123, 'john']? - CORRECT ANSWER [123,
'john',123, 'john']



13. Which of the following is correct about tuples in Python? - CORRECT ANSWER ***



14. What is the output of print(myTuple) if myTuple = ('abcd',786,2.23)? - CORRECT ANSWER
('abcd',786,2.23)



15. What is the output of print(myTuple[1:3]) if myTuple=('abcd',786,2.23)? - CORRECT ANSWER (786,
2.23)



16. What is the output of print (myTuple[0]) if myTuple = ('abcd',786,2.23)? - CORRECT ANSWER abcd



17. Which function obtains all the keys from a dictionary? - CORRECT ANSWER keys()



18. Which function obtains all the values from a dictionary? - CORRECT ANSWER values()



19. Which function converts a string to an int ? - CORRECT ANSWER int("string")



20. Which function converts a string to a float ? - CORRECT ANSWER float("string")



21. Which function converts a string to a tuple ? - CORRECT ANSWER tuple("string")



22. Which function converts a string to a list ? - CORRECT ANSWER list("string")



23. Which function converts a sequence of tuples to dictionary ? - CORRECT ANSWER dict()

Document information

Uploaded on
April 5, 2025
Number of pages
6
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ROSEGRADES
3.4
(35)
Sold
236
Followers
87
Items
12121
Last sold
3 weeks ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions