cs cs cs cs ts pmo pmo pmo

0.0(0)
studied byStudied by 9 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Get a hint
Hint

what is print used for

Get a hint
Hint

The print() function prints the specified message to the screen, or other standard output device

Get a hint
Hint

how to use print

Get a hint
Hint

1) Use the syntax print()

2) Insert a specified message between the parentheses.

3) If string use double quotation marks before and after the message.

4) If it is a numeric value, the before is unnecessary.

Card Sorting

1/8

Anonymous user
Anonymous user
encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

9 Terms

1
New cards

what is print used for

The print() function prints the specified message to the screen, or other standard output device

2
New cards

how to use print

1) Use the syntax print()

2) Insert a specified message between the parentheses.

3) If string use double quotation marks before and after the message.

4) If it is a numeric value, the before is unnecessary.

3
New cards

TWO DIFFERENT DATA TYPES AND DEFINITION

Integer data types→ A data type that stores whole numbers, either positive or negative, without decimal points. 

String data type → A data type that store sequence of characters, digits or symbols enclosed between the double quotes that is treated like text. 

A boolean data type → a data type that can store only two values: true or false. It's used to store and represent logical values

The float data type → data type that stores numbers with fractions 


4
New cards




WHAT DO WE USE INPUT FOR 


We use input to fetch an input from the user.


5
New cards

HOW TO USE INPUT() 


  1. Variable assigned to input() function

  2. Inside the parentheses of input(), we provide a prompt (enclosed in double quotation marks ("").

  3. The user's input is stored in the variable.

6
New cards

VARIABLES

VARIABLES → memory locations whose value may change during execution of the program


7
New cards

variable name rules

A variable name 

  • consist of letters, digits, and underscore 

  • Start with a letter, underscore. Not digit

  • Cannot have a space in between 

  • Cannot be a keyword 

  • Python → case sensitive 

    • Uppercase different to those in lower case

8
New cards

ASSIGNING MULTIPLE VALUES TO MULTIPLE VARIABLES EXAMPLE

x,y,z = 2,5,”hello”


x=2

y=5

z=”hello”


9
New cards

ASSIGNING SAME VALUE TO MULTIPLE VARIABLES

x = y = z = 25