0% found this document useful (0 votes)
2 views

Python Question bank

The document explains Python operators, including membership operators ('in' and 'not in'), identity operators ('is' and 'is not'), and loops ('for' and 'while') with examples. It also describes Android Virtual Devices (AVD) and emulators, highlighting their roles in simulating Android devices for application testing and development. AVDs allow developers to specify device characteristics, while emulators provide capabilities to test applications without physical devices.

Uploaded by

gautamsp22hdcomp
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Python Question bank

The document explains Python operators, including membership operators ('in' and 'not in'), identity operators ('is' and 'is not'), and loops ('for' and 'while') with examples. It also describes Android Virtual Devices (AVD) and emulators, highlighting their roles in simulating Android devices for application testing and development. AVDs allow developers to specify device characteristics, while emulators provide capabilities to test applications without physical devices.

Uploaded by

gautamsp22hdcomp
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

Explain two Membership and two logical operators in python with appropriate
examples.

Membership operator in python is used to check if the value exists in a lists,


strings, tuples, dictionary. They are the special operator which simplifies the
process of checking the values in the data structure.

There are 2 types of membership operator in python -


1) In - The in operator returns boolean. True if the value exists in data
structure and “False” if the value doesn't exist.

Example-

fruits = ["Banana", "Apple", "Grapes"]


if "Banana" in fruits:
print("Banana is in fruits") # This will evaluated
to True

2) Not in - The Not in operator also returns boolean. True if value doesn’t
exist and “False” if the value exists in the data structure.

fruits = ["Banana", "Apple", "Grapes"]


if "Banana" not in fruits:
print("Banana is in fruits") # This will evaluated
to False

Explain different loops available in python with suitable examples.

Loop- Loops in python are the repetition block of code. It will run till the
condition is not satisfied.
There are mainly 2 types of loops in python:
1) For loop -
- The for loop is a loop in which it has declaration, condition and
increment or decrement in its structure.
- This loop is helpful when the user know the ending condition
- Example -
n = int(input("Enter the number: "))
fact = 1
for i in range(1, n+1):
fact*=i
print("Factorial of "+ str(n) + " is: ", fact)

2) While loop-
- The while loop has only condition in it’s block.
- This loop is helpful when we don’t know about ending condition.
- Example -
i = 0
while i < 10:
print(i)
i+=1

Describe any two identity operators.

Identity Operators -
- Identity Operators in python are used to check if the variables are
pointing to the same objects because the python is dynamic language
then all the values are stored as an object. There are 2 types of Identity
operators-
- Is
a) The is operator returns true if the first when both the variables are
pointing to same objects otherwise will return false
Example -

a = [5]
b = [5]
c = b

print(a is b) # This will evaluate to False


print(c is b) # This will evaluate to True

- Is not
a) The is not operator return true if both the variables are not
pointing to similar objects. Otherwise it will return to be true.
Example -

a = [5]
b = [5]
c = b
print(a not is b) # This will evaluate to True
print(c not is b) # This will evaluate to
False

- An Android Virtual Device (AVD) is a configuration system that


enables the developers to simulate virtual android devices on
their development machines.
- It allows the developer to specify the hardware and software
characteristics of a selected target device.
- AVD manager is an interface which is integrated with android
studio to create and manage AVDs.
- AVD works in conjunction with emulators that allows
developers to install applications and run it without
downloading on their own physical devices.

- An Android Virtual Device (AVD) is a configuration system that


enables the developers to simulate virtual android devices on
their development machines.
- It allows developers to specify hardware and software
characteristics to select the targeted device.
- AVD manager is an interface that works with android studio to
create and manage AVDs.
- AVD works in conjunction with emulators that enables
developers to install applications and test it without installing it
on their physical device.

- The android emulator simulates android devices on your


computer so that you can test your application on a variety of
devices and android API levels without needing to have each
physical device.
- The emulator provides almost all of the capabilities of a real
android device. You can simulate incoming phone calls and
text messages, specify the location of the device, simulate
different network speeds, simulate rotation and other
hardware sensors, access Google Play store, and much more.
- Testing your app on the emulator is in some ways faster and
easier than doing so on a physical device.
- For Example - you can transfer data faster to the emulator
than to a device connected over a USB.
* The Android Emulator is a core development tool integrated with
Android Studio that simulates Android devices on your computer,
allowing you to test applications on various devices and Android API
levels without needing physical devices.

* The emulator works with Android Virtual Device (AVD)


configurations and provides almost all capabilities of a real Android
device. You can simulate incoming phone calls, text messages,
specify device location, simulate different network speeds, and
simulate rotation and other hardware sensors.

* It provides comprehensive testing features including access to


Google Play Store, debugging tools, and performance monitoring
capabilities that help developers ensure their apps work across
different device configurations.

* The emulator offers enhanced development efficiency through


faster deployment, easier debugging, and the ability to test multiple
device configurations simultaneously, making it an essential tool for
Android app development.

- An Emulator is a development tool that simulates android


devices on your computer & allows you to test the applications
on various android devices and API levels without needing any
physical device.
- An Emulator works with Android Virtual Device (AVD)
configurations & provides almost all the capabilities of real
android devices including phone calls, text messages, device
location & hardware sensors.

- An Android Virtual Device (AVD) is a configuration system that


simulates virtual android devices on their own development
machine.
- It allows developers to specify the hardware and software
characteristics of selected target devices.
- AVD manager is an interface that works with android studio to
create and manage the AVDs.
- AVD works in conjunction with emulators that provide
developers to install the application and test it without
installing on their own physical device.

- An Emulator is a development tool that simulates android


devices on your computer and allows you to test the
application on various devices and API levels without needing a
physical device.
- An Emulator works with Android Virtual Device AVD
Configuration and provides the capabilities of real android
devices including phone calls, text messages, device location
and hardware sensors.

- An Emulator is a development tool that simulates android


devices on your own computer and allows you to test the
application on various devices and API levels without needing a
physical device.
- An Emulator works with Android Virtual Device (AVD)
configuration and provides almost all the capabilities of real
android devices including phone calls, text message, device
location & hardware sensor.
- An Emulator is a development tool that simulates android
devices on your computer and allows you to test the
applications on various android devices and API levels without
needing a physical device.
- An Emulator works with Android Virtual Device (AVD)
configuration and provides almost all the capabilities of real
android devices including phone calls, text messages, device
location & hardware sensors.
- An Android Virtual Device (AVD) is a configuration system that
simulates virtual android devices on their own development
machines.
- It allows developers to specify hardware (such as RAM,
storage) and software (Android version, API levels)
characteristics of the selected target device.
- AVD manager is an interface that works with android studio to
create and manage AVDs.
- AVD works in conjunction with emulators that allows
developers to install the application and test it without
installing on their own physical device.

You might also like