Search Header Logo

Introduction to Python

Authored by Arkadeep Ghosh

University

Used 532+ times

Introduction to Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a correct syntax to return the first character in a string?

x="Hello".sub(0,1)

x="Hello"[0]

x=sub("Hello",0,1)

x=substring("Hello",0,1)

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Identify the below expressions which would result in False?

a) False and True b) 1==1 or 2==1

c) 1==1 and 2!=1 d) True and 1==1 e) False or 1>2

c, d

a, e

b, c, d

a, c

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is the output of the below code snippet?

num1=10

num2=7//2

num2*=num1

print(num2)

10

35.0

30

30.0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

y = 4

z = lambda x : x ** y

print z(3)

81

12

64

None of the above

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the below code snippet?

P 9

Q 10

R 2

S 6

Tuple is immutable, so it will throw an error

P 9

Q 10

R 2

S 6

T 6

None of the above

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the below code?

num_list = [10.5,30.5,-1.20,10.10]

num_list.insert(-3, -10.5)

num_list.pop(0)

print(num_list[0])

30.5

-10.5

10.1

-1.2

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the code given below?

got it

lcome to Hyd

come to Hyd

come to Hyde

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?