denise124
denise124 22h ago • 0 views

Easy Python Print Examples for Kids: Printing Names and Greetings

Hey there! 👋 Learning to code can be super fun, especially when you start with something simple like printing names and greetings. Let's learn how to do that in Python with some easy examples and then test your knowledge with a quick quiz! 🐍
💻 Computer Science & Technology
🪄

🚀 Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

✨ Generate Custom Content

1 Answers

✅ Best Answer

📚 Quick Study Guide

  • 🐍 Python uses the print() function to display output on the screen.
  • 👋 You can print text (strings) by enclosing them in single quotes (') or double quotes (").
  • ➕ You can combine (concatenate) strings using the + operator. For example, 'Hello' + 'World' becomes 'HelloWorld'.
  • ✨ Variables can store data like names. You can then print the value of the variable.
  • 😀 You can print greetings by combining strings and variables.

Practice Quiz

  1. What does the following Python code print?

    print('Hello, world!')
    1. A. Hello world!
    2. B. 'Hello, world!'
    3. C. Error
    4. D. Hello, world
  2. Which of the following is the correct way to print your name in Python?

    1. A. print(Name)
    2. B. print("Your Name")
    3. C. Print['Your Name']
    4. D. echo 'Your Name'
  3. What will be the output of the following code?

    name = "Alice" print("Hello, " + name + "!")
    1. A. Hello, name!
    2. B. Hello, Alice!
    3. C. "Hello, Alice!"
    4. D. Error
  4. Which of the following is NOT a valid way to define a string in Python?

    1. A. 'Hello'
    2. B. "Hello"
    3. C. `Hello`
    4. D. str("Hello")
  5. What happens if you try to print a variable that hasn't been assigned a value?

    1. A. It prints 0
    2. B. It prints an empty string
    3. C. It raises an error
    4. D. It prints 'None'
  6. What will this code print?

    greeting = "Good morning" print(greeting, "World!")
    1. A. Good morningWorld!
    2. B. Good morning World!
    3. C. Error
    4. D. "Good morning", "World!"
  7. How do you print a multi-line string in Python?

    1. A. Using triple quotes (''' or """)
    2. B. Using multiple print() statements
    3. C. Using the \n character
    4. D. All of the above
Click to see Answers
  1. Answer: A
  2. Answer: B
  3. Answer: B
  4. Answer: C
  5. Answer: C
  6. Answer: B
  7. Answer: D

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀