24UCS171 - Python Programming - Unit 1
45 flashcards · Programming Languages · by Sikkandhar Batcha J
Which mode of Python allows you to type code and see results immediately?,Interactive mode,Script mode,Batch mode,Debug mode,A
Which Python mode is better for writing large programs?,Script mode,Interactive mode,Single-line mode,Inline mode,A
What is the file extension for Python scripts?,.py,.pyt,.pt,.p,A
Which key combination exits Python interactive mode?,Ctrl+D,Ctrl+C,Ctrl+Z,Alt+F4,A
Which command starts Python interactive shell?,python,py start,python shell,run python,A
Which of the following is a popular Python IDE?,PyCharm,NetBeans,Eclipse,Visual Basic,A
Which IDE comes pre-installed with Python?,IDLE,PyCharm,Jupyter,VS Code,A
Jupyter Notebook is mainly used for?,Data Science,Game Development,Web Design,System Programming,A
Which of these IDEs is web-based?,Jupyter Notebook,IDLE,PyCharm,VS Code,A
Which IDE is lightweight and often used for quick Python scripting?,IDLE,Eclipse,NetBeans,Xcode,A
Which of the following is NOT a numeric type in Python?,char,int,float,complex,A
What is the output of type(10.0)?,float,int,complex,double,A
Which data type is immutable?,Tuple,List,Dictionary,Set,A
Which data type allows duplicate values?,List,Set,Dictionary,None,A
Which data type stores key-value pairs?,Dictionary,Tuple,Set,List,A
Which of the following is a valid Python variable name?,name_2,2name,name-2,name.2,A
Which operator is used for exponentiation in Python?,**,^,//,exp,A
What is the result of 7 // 2?,3,3.5,4,2,A
Which operator is used for logical AND in Python?,and,&,AND,&&,A
Which operator is used for membership checking?,in,is,==,has,A
What is the result of 5 & 3?,1,7,2,0,A
What is the result of 5 | 3?,7,1,2,0,A
What is the result of 5 ^ 3?,6,7,2,1,A
Which operator shifts bits to the left?,>,^,//,A
Which operator inverts all bits?,~,!,not,^,A
Which function is used to take input from the user?,input(),scanf(),read(),cin>>,A
Which function is used to print output in Python?,print(),write(),echo(),printf(),A
What is the default type of input() value?,str,int,float,bool,A
How do you print without a newline at the end?,print(..., end=''),print(..., stop=''),printline(...),print.noend(...),A
Which method is used for formatted output?,format(),printf(),sprintf(),fprint(),A
What will be the output of print('Hello %s' % 'World')?,Hello World,Hello,Hello %s,Error,A
Which is the modern way of formatting strings in Python?,f-strings,format(),concat(),join(),A
f-strings were introduced in which Python version?,3.6,2.7,3.0,3.8,A
What is the output of print(f'{10/3:.2f}')?,3.33,3.333,3.3,Error,A
Which operator is overloaded by the '+' symbol in Python?,Concatenation,Multiplication,Division,Subtraction,A
Strings in Python are?,Immutable,Mutable,Volatile,Dynamic,A
Which method is used to convert string to lowercase?,lower(),tolower(),str.lower(),down(),A
Which of the following slices the string s='Python' to 'Pyt'?,s[:3],s[:2],s[0:2],s[1:3],A
Which operator is used for string repetition?,*,+,x,repeat(),A
What is the output of 'Python'[::-1]?,nohtyP,Python,Error,htypno,A
Which method is used to add an element to a list?,append(),insert(),add(),push(),A
Which of the following removes and returns the last element of a list?,pop(),remove(),delete(),discard(),A
Which method is used to add an element to a set?,add(),append(),insert(),push(),A
Dictionaries do not allow?,Duplicate keys,Duplicate values,Nested dictionaries,Any values,A
Which data type is ordered and changeable?,List,Tuple,Set,Dictionary,A