Python
Learn Python by writing it. Four hands-on exercises with instant feedback: print, variables, control flow, and functions, all graded in your browser.
- Level
- Beginner
- Lessons
- 4
- Duration
- 63 min
Python Basics
Getting Started with Python
Python programs are read top to bottom, one line at a time. The print() function writes text to the screen. In this first exercise you will print a greeting, store some text in a variable, and print it back out.
Instructions
1.Use print() to display the exact text Hello, World! (with the comma and exclamation mark).
2.Create a variable called name and assign it a string containing your name.
3.On a new line, print the text My name is followed by a space and the value of name. Use a comma inside print() or an f-string.
Editor
Python not loadedmain.py
Loading editor…
Output
Run your code to see output here.