This projects allow you to enter python code, and interprets it in real time. All the functions and how to use it are in the sections down below! If you want to share your project just set the "Sharing project?" variable to 1 and click the "remix" button then share. And please, like and favourite this project so it gets shown to more people. I spent a while refining it to make it what it is now, and more recognition will help me be motivated to make more. Use on turbowarp for optimal performance: https://turbowarp.org/722186690?turbo&fps=60 Or with turbo-mode (Shift + click green flag), but turbowarp gives better results. *******HOW TO USE******* You can edit lines by simply clicking on them, a question box will appear, click on it and enter the code. To add more lines click the plus icon next to the line you want the new line to be underneath. You can delete lines by clicking the trash icon to the right of the plus icon. Running your code can be done by clicking the triangle in the top right corner. Most functions are missing because either I'm too lazy or I don't think the average scratcher would know of. So please, if you have anything you want me to add just comment it. I can probably implement it a couple of days if I see your suggestion. *******VARIABLES******* Declaring variables can be done by typing the name of the variable, then = value. E.g. my_variable = 0 There are 5 different types of variables: int: variable = 5 Integer variables can only hold one whole number (a number without a decimal). float: variable = 5.1 Floating point variables are variables that can hold numbers with decimals. str: variable = "Text" String variables hold text, like letters numbers and symbols. NoneType: variable = None NoneType variables represents the absence of a value, hence the name "None." Boolean variable = True Boolean store either a true of false value *******OPERATIONS******* Operator allow you to do complex calculations in your code. e.g: 3+3*(7-8) +: Addition This can add two numbers together, or concatenate two strings. -: Subtraction This can subtract two numbers together. *: Multiplication This can multiply two numbers together, or repeat a string an integer amount of times. /: Division This can divide two numbers together. //: Integer Division This can do floor division between two numbers. **: Exponet This can do exponent on another number. %: Modulo This returns the remainder of a division between the 2 numbers. BITWISE OPERATORS: &: Bitwise AND This will return the "and" product of two numbers. ^: Bitwise XOR This will return the "exclusive or" product of two numbers. |: Bitwise OR This will return the "or" product of two numbers. >>: Bitwise Right Shift This shift the first number's bits to the right the second number amount of times. <<: Bitwise Left Shift This shift the first number's bits to the left the second number amount of times. You can directly apply these operations to a variable with a value by typing the variable's name, then the operation and '=' sign then the other value you want to do that operation on. E.g. adding 2 to 'my_variable' my_variable += 2 COMPARASON OPERATORS: ==: is equal Check if two values are equal to each other !=: not equal Check if two values are not equal to each other >: More than Checks if the left number is greater than the right number <: Less than Checks if the left number is less than the right number >=: More than or equal to Checks if the left number is more than or equal to the right number <=: Less than or equal to Checks if the left number is less than or equal to the right number All these operators return a Boolean (True/False) *******IF STATEMENTS******* An if statement runs code only when its condition is true. In Python, the condition goes after if, ending with a colon. The code beneath must be indented, usually with four spaces (but can be any number of spaces), to show it belongs to the if. Use elif for extra checks and else for alternatives. An example of this is: if x==1: print("x is equal to one") elif x==2: print("x is equal to two") else: print("x is not equal to either one, or two")
*******LOOPS******* A while loop repeats code as long as its condition is true. The condition follows while and ends with a colon. The loop’s body must be indented, commonly four spaces (but can be any number of spaces). If the condition never becomes false, it creates an infinite loop. Use carefully to control repetition. An example of this is: while x<100: x+=1 This will increment x by 1 until it reaches 100, then end the loop. In loops, you can use break and continue control flow. break immediately ends the loop, skipping any remaining iterations. continue skips just the current iteration, moving to the next. Both must be placed inside the loop’s indented block, usually under if conditions, to adjust execution behaviour dynamically. *******FUNCTIONS******* print(args*) -> NoneType: The print function can take as many arguments as you provide. It will add a space between the argument values in the terminal. It returns a NoneType. input(prompt) -> str: The input function can only take one or no values. It prompt the user on the prompt, and the answer will be returned. type(object) -> str: Return the type of input inputted. int(object) -> int: Returns the integer equivalent to the input. float(object) -> float: Returns the float equivalent to the input. str(object) -> float: Returns the string equivalent to the input. bool(object) -> bool: Returns the Boolean equivalent to the input. len(object) -> int: Returns how long a value is. eval(str)-> any: Returns the evaluated value of the inputted string. *******TEXT ENGINE CHARACTERS******* ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuwxyz1234567890 `~!@#$%^&*()-_=+[{]}\|;:'",<.>/? *******EXAMPLE CODE******* Paste these examples into the project to see what they do. Adding calculator: num=float(input("Number 1:"))⧫num+=float(input("Number 2:"))⧫print("The answer is", num) Text repeater: text=input("What do you want to be repeated? ")⧫amount=int(input("How many times do you want to repeat '"+text+"'?"))⧫print(text*amount) Count to 10: x=0⧫while x<10:⧫ x+=1⧫ print(x) Triangle maker: x=0⧫count = int(input("how big do you want your triangle? "))⧫while x<count:⧫ x+=1⧫ print("#"*x) Calculator: x=input("What do you want to calculate? ")⧫print(eval(x)) *******INCORRECT OUTPUT******* If there's something that is unexpected, like the program freezing, or the output of an expression is incorrect, please report the problem by exporting your code and paste it in the comments with a description of the problem you experiencing. I will get back as soon as possible for an explanation (if its a user error,) or a fix (if its an interpreter error.) #python #code #interpreter #calculations #scientific #math #numbers #programs #coding #programming #trending