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
- Create a variable called
skill_completed
and set it equal to the string"Python Syntax"
. - 2. Create a variable called
exercises_completed
and set it equal to13
. Create another variable calledpoints_per_exercise
and set it equal to5
. - 3. Create a variable called
point_total
and set it equal to100
. - 4. Update
point_total
to be what it was before plus the result of multiplyingexercises_completed
andpoints_per_exercise
. - Hint!
- You can add to a variable by using
+=
:total += number_to_addwhich 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 ofpoint_total
whereX
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.
Can you please update your blogs, we are waiting for new blogs.......
ReplyDeleteHi, 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.
ReplyDeletebest python training in coimbatore
Android training in coimbatore
Networking training in coimbatore
If you Liked it, Don't forget to Share it.
ReplyDelete" Sharing is Caring :) "
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!
ReplyDeletelist to string python
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
ReplyDeleteI 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
ReplyDeleteI 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
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteExcellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. python training london
ReplyDeleteIt is a great website.. The Design looks very good.. Keep working like that!. python training london
ReplyDeleteA 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
ReplyDeletehttps://csnip2020.blogspot.com/2020/07/python-installation-steps.html?showComment=1636616273329#c834529903571727403
ReplyDelete