Search Header Logo
PYTHON 203

PYTHON 203

Assessment

Presentation

•

Science, Computers

•

University

•

Hard

Created by

Dr. Rahman

Used 20+ times

FREE Resource

10 Slides • 28 Questions

1

PYTHON 203

DR Farzana Rahman​

2

Python Introduction

Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.

It is used for:

  • web development (server-side),

  • software development,

  • mathematics,

  • system scripting.

Some text here about the topic of discussion

3

Python USE
  • Python can be used on a server to create web applications.

  • Python can be used alongside software to create workflows.

  • Python can connect to database systems. It can also read and modify files.

  • Python can be used to handle big data and perform complex mathematics.

  • Python can be used for rapid prototyping, or for production-ready software development.

Some text here about the topic of discussion

4

Python language compared to other programming languages

  • Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc) and has a simple syntax similar to the English language.

  • Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

  • Python runs on an interpreter system, meaning that code can be executed as soon as it is written.

  • Python can be treated in a procedural way, an object-oriented way or a functional way.

Some text here about the topic of discussion

5

Python Syntax compared to other programming languages

  • Python was designed for readability, and has some similarities to the English language with influence from mathematics.

  • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses.

  • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.

Some text here about the topic of discussion

6

Multiple Choice

How python syntax defines a scope

1

using indication

2

using semicolon

3

using bracket

4

using colon

7

media
PYTHON WITH GOOGLE COLAB

​Some text here about the topic of discussion.

8

media
PYTHON SYNTAX​

​Some text here about the topic of discussion.

9

Multiple Choice

Which sign python uses to complete a command ?

1

semicolon

2

parentheses

3

colon

4

new line

10

COMMETS
  • Comments starts with a #, and Python will ignore them.

  • Python does not really have a syntax for multi line comments.

  • To add a multiline comment you could insert a # for each line​.

  • ​Since Python will ignore string literals that are not assigned to a variable, you can add a multiline string (triple quotes) in your code, and place your comment inside it (CHECK EXAMPLE)

​

Some text here about the topic of discussion

11

Multiple Choice

What is the Python syntax for multiline comment?

1

#

2

##

3

//

4

No Syntax

12

Multiple Choice

Select the correct answer

1

A variable is created the moment you declare the type

2

Variables are needed to be declared with particular type

3

A variable is created the moment you first assign a value to it

4

Python has specific command for declaring a variable.

13

Multiple Choice

Which Variable name is right?

1

7myclass

2

my_class

3

my-class

4

my class

14

Multiple Choice

The most common python output function is-

1

printf()

2

print()

3

cout()

4

cin()

15

Multiple Choice

In a python code global variable can be used -

1

inside a function

2

outside a function

3

in a specific function

4

both inside and outside of a function

16

Multiple Select

Select the built in data types of python? You can choose multiple answers

1

integer

2

float

3

character

4

complex

17

Multiple Select

Which one are right syntax to define string data type in python? You can choose multiple answers

1

x="Hello"

2

x=["Hello"]

3

x='Hello'

4

x={Hello}

18

Multiple Choice

X="HELLO_PYTHON"

print(x[3:8]) command outputs

1

LLO_PY

2

LO_PY

3

LO_PYT

4

O_PYT

19

Multiple Choice

x = "Hellopython"

print(x[:5]) output is

1

Hello

2

ellop

3

Hellop

4

ellopy

20

Multiple Choice

x = "Hipython"

print(x[3:]) outputs

1

python

2

ython

3

thon

4

ipython

21

Multiple Choice

x = "Hello_Students!"

print(b[-8:-2]) outputs

1

tudents!

2

tudents

3

student

4

tudent

22

media
List, Tuple, SET,Dictionary

​

​

​Some text here about the topic of discussion.

23

Multiple Select

(You can choose multiple answer)

Properties of LIST-

1

Ordered

2

Changeable

3

accept duplicates

4

unchangable

24

Multiple Choice

How can we Add item in specific location of a List

1

using add() function

2

using append() function

3

Using insert() function

25

Multiple Select

You can choose multiple answer)

Properties of TUPLE-

1

Ordered

2

Changeable

3

accept duplicates

4

unchangable

26

Multiple Choice

HOw can we add element in a Tuple

1

using append () function

2

changing tuple to list

3

using insert() function

4

using update() function

27

Multiple Select

(You can choose multiple answer)

Properties of SET-

1

Ordered

2

Changeable

3

accept duplicate

4

unchangable

28

Multiple Select

(you can choose multiple Answers)

How can we add elements in set

1

add() function

2

append() function

3

update() function

4

insert() function

29

Multiple Choice

Which one is true

1

we can add and remove item from sets

2

We can add and remove item from tuple

3

We cannot have duplicate item in list

4

Set items are ordered and indexed

30

Multiple Choice

Which one is immutable

1

List

2

Tuple

3

SET

4

both List and Tuple

31

Multiple Select

(You can choose multiple answer)

Properties of Dictionary-

1

Ordered

2

Changeable

3

accept duplicate

4

unchangable

32

Multiple Select

which method are used to access keys in dictionary

[you can select multiple answer]

1

get()

2

keys()

3

find()

4

in()

33

Multiple Select

What update method can do

[you can select multiple answer]

1

update value

2

update keys

3

update dictionary

4

add new value

34

media
Class

​

​

​Some text here about the topic of discussion.

35

Multiple Choice

What keyword is used to define class?

1

myclass

2

newclass

3

class

4

makeclass

36

Multiple Choice

How to define a class?

1

Class Classname:

attributes

2

Class: Classnane

attributes

3

Classname Class:

attributes

37

Multiple Choice

How to initialise attribute information in Class

1

using define function

2

using

__init__

function

3

using

new function

4

using

attribute function

38

Multiple Choice

What is reference variable ?

1

A variable that is used to access attributes of the class

2

A variable that is used to access variables that belong to the class

3

A variable that is used to call class function

4

both 1st and 2nd choice.

pattern-tertiary
PYTHON 203

DR Farzana Rahman​

Show answer

Auto Play

Slide 1 / 38

SLIDE