This is a tutorial on how to code a little more efficiently in Python.
TIP #1
Have you ever forgotten to put quotations/parentheses around a string? Well here is a tip to save you a few seconds. Double click/highlight the text that you want to put quotations around, then just press the ' or " or ( key and the highlighted text will have quotations/parentheses around it!
TIP #2
Have you ever made a bunch of functions with attributes, but when you needed to add another attribute, it took forever to change all of the functions? Well, there are two solutions to this problem.
SOLUTION A:
It is possible to have Multiple Cursors in Repl. Click where you want to edit the text, then use Control + Click and click where you want to add the second cursor. Then, when you type something, all cursors will respond, typing the same thing in multiple places
SOLUTION B:
The second solution is that you can use Ctrl + H to open up a find & replace bar. On the top, paste in the code you want to replace, and on the bottom input the code that you want to replace it with. You can now replace everything easily.
TIP #3
This is a quicker way to write your import statements: instead of writing
import random
import time
import os
import sys
You can use:
import random, time, os, sys
which can save you from typing a few lines of code.
TIP #4
Have you ever had to indent a lot of code? You can indent a large block of code by highlighting all of it, then pressing Tab(to indent) or Shift + Tab(to unindent).
I hope this little tutorial helps you code a little bit more efficiently. Please consider upvoting!
3 quick tips to help you code a little more efficiently
HELLO EVERYBODY
This is a tutorial on how to code a little more efficiently in Python.
TIP #1
Have you ever forgotten to put quotations/parentheses around a string? Well here is a tip to save you a few seconds. Double click/highlight the text that you want to put quotations around, then just press the ' or " or ( key and the highlighted text will have quotations/parentheses around it!
TIP #2
Have you ever made a bunch of functions with attributes, but when you needed to add another attribute, it took forever to change all of the functions? Well, there are two solutions to this problem.
SOLUTION A:
It is possible to have Multiple Cursors in Repl. Click where you want to edit the text, then use Control + Click and click where you want to add the second cursor. Then, when you type something, all cursors will respond, typing the same thing in multiple places
SOLUTION B:
The second solution is that you can use
Ctrl + H
to open up a find & replace bar. On the top, paste in the code you want to replace, and on the bottom input the code that you want to replace it with. You can now replace everything easily.TIP #3
This is a quicker way to write your import statements: instead of writing
You can use:
which can save you from typing a few lines of code.
TIP #4
Have you ever had to indent a lot of code? You can indent a large block of code by highlighting all of it, then pressing
Tab
(to indent) orShift + Tab
(to unindent).I hope this little tutorial helps you code a little bit more efficiently. Please consider upvoting!
fantastic, but I already know some. can you have me more tips?