June 10, 2019

Srikaanth

Samsung Electronics Python Interview Questions

Samsung Electronics Python Recently Asked Interview Questions Answers

What Programming Paradigm does Python supports?

Python supports both Procedural Programming approach as well as Object Oriented Programming Approach. Moreover, you can use both the approaches in a single Python program.

What is the difference between input() method and raw_input() method?

raw_input() method returns string values whereas input() method returns integer vaues.
Input() method was used in Python 2.x versions whereas Python 3.x and later versions use raw_input() method. However, input()method has been replaced by raw_input() method in Python 3.x.

What is the output of print list[2:] if list = [ ‘abcd’, 786 , 2.23, ‘john’, 70.2 ]?

It will print elements starting from 3rd element. Output would be [2.23, ‘john’, 70.200000000000003].

What is the output of print tinylist * 2 if tinylist = [123, ‘john’]?

It will print list two times. Output would be [123, ‘john’, 123, ‘john’].

Samsung Electronics Python Recent Asked Interview Questions Answers
Samsung Electronics Python Recent Asked Interview Questions Answers

What is the purpose of is operator?

is − Evaluates to true if the variables on either side of the operator point to the same object and false otherwise. x is y, here is results in 1 if id(x) equals id(y).

What is the difference between Lists and Tuples in terms of Syntax?

Both Lists and Tuples are used to store a sequence of data within them. However, a major difference between them is that Tuples use parantheses ( ) in its syntax whereas Lists use Brackets in its syntax [ ].

What is the difference between Text Entry element and Text Box element in Tkinter Module?

A Text Entry element is used to receive an input of only one single line whereas a Text Box provides a space to receive input for multiple lines.

How do you create a Check Button Element in Python?

The CheckButton class is available in Tkinter Module. We first need to import it and then we can take in a frame label by the following command:

checkbutton1 = Checkbutton(frame1, text= “C Programming”)
checkbutton1.grid()

checkbutton1 is a variable to hold the Check Button Element and frame1 is the name of the Frame variable onto which we want to adjust our Check Button. It takes in a parameter named as Text which is used to display the name for the Check Button.


Is There A Switch Or Case Statement In Python? If Not Then What Is The Reason For The Same?

No, Python does not have a Switch statement, but you can write a Switch function and then use it.

What Is A Built-In Function That Python Uses To Iterate Over A Number Sequence?

range() generates a list of numbers, which is used to iterate over for loops.

for i in range(5):
    print(i)

The range() function accompanies two sets of parameters.

range(stop)

stop: It is the no. of integers to generate and starts from zero. eg. range(3) == [0, 1, 2].

range([start], stop[, step])

start: It is the starting no. of the sequence.
stop: It specifies the upper limit of the sequence.
step: It is the incrementing factor for generating the sequence.

Points to note:

Only integer arguments are allowed.
Parameters can be positive or negative.
The <range()> function in Python starts from the zeroth index.


What is the output of print list[1:3] if list = [ ‘abcd’, 786 , 2.23, ‘john’, 70.2 ]?

It will print elements starting from 2nd till 3rd. Output would be [786, 2.23].

What is the purpose of not in operator?

not in − Evaluates to true if it does not finds a variable in the specified sequence and false otherwise. x not in y, here not in results in a 1 if x is not a member of sequence y.

What is the purpose break statement in python?

break statement − Terminates the loop statement and transfers execution to the statement immediately following the loop.

https://mytecbooks.blogspot.com/2018/08/samsung-electronics-python-recently.html
Subscribe to get more Posts :