Presentation is loading. Please wait.

Presentation is loading. Please wait.

Please log on The. AN INTRODUCTION TO ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages.

Similar presentations


Presentation on theme: "Please log on The. AN INTRODUCTION TO ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages."— Presentation transcript:

1 Please log on The

2 AN INTRODUCTION TO

3

4 ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages available to the public and is used daily to create anything from games to Operating Systems. Coding language is the foundations of anything you use on the computer – Python is but one of them. WHAT IS PYTHON?

5 Variables Strings Strings and Variables Combining Numbers and Strings WHAT WE’RE LEARNING

6 Variable Value

7 red=15 blue=10 yellow=5 print(red,blue,yellow) red=15 blue=10 yellow=blue print(red+blue+yellow)

8 bool=True name=‘ ………… ’ age=………… print (name + ‘ is ’ + str(age) + ‘ years old ’) EXERCISE

9 Strings A string is just a combination of letters in order, e.g. “The IT Crowd” A String can be declared by either single, double or triple quoting the string – e.g. ‘The IT Crowd’ “The IT Crowd” “““The IT Crowd” ” ” The you want to incorporate quotation marks into the string itself then you need to put a backslash before them e.g. ‘Nathaniel said \“Hello Everyone\”’

10 Combining Variables and Strings We’re going to write a question which the user can respond to question= “What did you have for lunch?” print(question) answer= input() put your answer here print(“You had ” + answer+ “ for lunch?”)

11 question= “What\’s your name?” print(question) answer= input() (insert name here) print=(“ You\’re called ” + answer + “ ?”)

12 Combining Numbers and Strings When using Python we have to tell the programme whether the value or word we’ve entered is either a string or an integer To do this we use the commands str() and int() We’re going to write a programme which asks the user for a question then adds 10 to that number print(“Give me a random number”) response=input() number=int(response) plusTen=number+10 print(“If we add 10 to your number we get ” + str(plusTen)

13 I want you to write a programme which asks what you had for lunch, then the price. The programme should then tell the user how much the meal would be with the addition of £1.00 Challenge

14 Recap What does each of these functions do? print(…..) input() len() str() int()

15 THANKS FOR COMING @BittTeam


Download ppt "Please log on The. AN INTRODUCTION TO ‘Python is a high-level, general purpose programming language’ Python is one of the many programming languages."

Similar presentations


Ads by Google