Presentation is loading. Please wait.

Presentation is loading. Please wait.

Input and Output Python3 Beginner #3.

Similar presentations


Presentation on theme: "Input and Output Python3 Beginner #3."— Presentation transcript:

1 Input and Output Python3 Beginner #3

2 Input and Output? input() print() Lets make output look nice!

3 Joining strings Python allows us to add strings together with the + symbol Create a variable called: name = “draps” Then lets format our output a little: print(“Hello, my name is “ + name) The part in quotes is a hard coded string. More dynamic code. Alternatively print(“Hello, my name is“, name)

4 input() function input() name = input("Please enter your name: ")
input() gets a string from the user.

5 Python files To get the true python coding experience we need to start writing instructions into a file. .py for Python! Create a file called tut3.py in your favorite text editor, I’ll use vim. Lets add some instructions similar to the ones we wrote just before.

6 Running .py files On linux, from the terminal you can execute a python script in the current directory by using the command: python3 tut3.py On Windows, right click the file and open with IDLE, then hit the run tab up the top and select “Run Module”

7 Multiply Program Lets make something a little more useful
Lets edit tut3.py We will get two numbers from the user Times them together and output the answer to the console.

8 Next Selection! Feel Free to leave questions in the comments I’ll try to answer all of them. Please Google your question first!


Download ppt "Input and Output Python3 Beginner #3."

Similar presentations


Ads by Google