PYTHON SYNTAX _14/14

Review

Great! we’ve looked at:
  • * Print statements
  • * How to create, modify, and use variables
  • * Arithmetic operations like addition, subtraction, division, and multiplication
  • * How to use comments to make your code easy to understand
  • * Different data types, including strings, ints, floats, and booleans
  • * Converting between data types
  • Exercise

  • 1.Let's apply all of the concepts you have learned one more time!
    Create a variable called skill_completedand set it equal to the string "Python Syntax".
  • 2. Create a variable called exercises_completed and set it equal to 13. Create another variable called points_per_exercise and set it equal to 5.
  • 3. Create a variable called point_total and set it equal to 100.
  • 4. Update point_total to be what it was before plus the result of multiplying exercises_completed and points_per_exercise.
  • Hint! 
  • You can add to a variable by using +=:
    total += number_to_add
    which is shorthand for:
    [new value of] total = [old value of] total + number_to_add
  • Exercise
  • 5.Add a comment above your declaration of points_per_exercise that says:
    The amount of points for each exercise may change, because points don't exist yet:
    6.Print a string to the console that says:
    I got X points!
    with the value of point_total where X is.
  • Hint! 
  • You can cast a numerical variable to a string and then add it to another string:
    print("This is " + str(1) + " long string!")
    >>> "This is 1 long string!"

  • SOL.







12 comments:

  1. Can you please update your blogs, we are waiting for new blogs.......

    ReplyDelete
  2. Hi, thanks for your blog, if you want to learn about programming languages like java, php, android app, embedded system etc. I think this training institute is the best one.
    best python training in coimbatore
    Android training in coimbatore
    Networking training in coimbatore

    ReplyDelete
  3. If you Liked it, Don't forget to Share it.
    " Sharing is Caring :) "

    ReplyDelete
  4. nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this!
    list to string python

    ReplyDelete
  5. I appreciate this piece of useful information. We are Providing the Export Import Course online Training Module to learn how to start Export Import Business with Certification Program For more information visit our site: Export Import Certificate Training Online

    ReplyDelete
  6. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. python course london

    ReplyDelete
  7. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. python course london

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. python training london

    ReplyDelete
  10. It is a great website.. The Design looks very good.. Keep working like that!. python training london

    ReplyDelete
  11. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. python course london

    ReplyDelete
  12. https://csnip2020.blogspot.com/2020/07/python-installation-steps.html?showComment=1636616273329#c834529903571727403

    ReplyDelete

Powered by Blogger.