Python Flashcards
What are diffierent type of datatypes in python?
integer, float, string, boolean, list, dictionary, sets, tuples
How to calculate mode and power in python?
%, **
Is it possible to assign different data types to same variable?
yes
How to reverse string?
s = hardik s_reversed = s[::-1]
How to get every alternate character?
s = hardik s_alternate = s[::2]
Indexes in string? are they mutable?
yes
How to split a sentence?
Split()
What are different methods for a string?
None
explain what is .format and fβ format? What is the difference?
None
Can we store different datatypes in list? How to add a value to a list
None
Explain indexing in list
None
List at least five methods for list
None
How do I index a nested list? For example if I want to grab 2 from [1,1,[1,2]]?
None
Define Dictionaries? Write one dictionary
None
How to assign values in dictionary
None
List key mehtonds for dictionary
None
What is set in python and how to create a sets?
None
Explain use of boolean datatypes
None
How to create file inside Jupyter notebook?
None
How to read a file? What happens if you read again?
None
What is the use of myfile.seek() method?
None
Why to use readlines() method?
None
In windows why there are to back slash?
None
What is the use of myfile.close()? How to avoid it? (with open)
None