can anyone help me? if you guys help me that good!
This is an overview of the basics to help you boost your start with python. I won't go through everything of course but enough for you to start your first application. Make sure you selected Python 3 instead of Python 2.
Variables in python are just like the ones in math but you have to define them. You can store different types of data like the ones below...
Booleans - True/False
Int/Integer - Numbers with no decimal
Double - Decimals
Long - Big Number
Short - Small Number
This is how we define each one
var myBoolean = True var myString = "A String" var myInt= -34 var myDouble= 43.143 var myShort = 10 var myLong =34123 var myByte = 2
The variable names are in the middle which you will need to call it... and you can name the variables anything without any special characters(!, +, #, etc)
Note: True/False in booleans MUST be capitalized
Operators is math. Done! Ok, here are the different types...
Addition - +(It adds stuff)
Subtraction- - (It subtracts stuff)
Multiplication- is the star above the 8 key (It multiplies stuff)
Division- / (It divides stuff)
*Modulus- % (It finds the remainder of an equation)
Here is the syntax
var mathNumber = 42 var password = 1234 var addition = mathNumber+password print(password%mathNumber)
As you can see my very AP math skills
The print statement is a very simple concept, all it does is display text in the terminal/console. In replit, you should see your program running on the side. Below is the syntax of the code for printing.
Whatever is in the quotes is printed so you can change it to "Creeper Aww Man" and it would work. We can also print variables like this (only if we have it defined)...
To print variables along strings you can do...
print("My Name is" + name)
Say you want to print What is your Name? and then print the user's name. To do this you would need to tell the computer you are getting there input.
name = input("What is your name?")
The code here makes a variable which you can use later to print or do something.
Note: the thing before the = sign is your variable name for pulling the data later.
What do we do when we want to check if data is equal to something... well if statements. This is the syntax to make if statements are...
if(age > 60): print("Sign Up for our senior program) else if(age == 9): print("Greetings 9-year-old") else: print("Hello"+age+"year-old")
Note: Indentations (press tab key, NO SPACES) are REALLY important for the syntax. If it is wrong you program will crash. This is only when the line before has ":" which means it continues to the next line so you need to indent the things you want to execute when that statement is true.
This is a very small part of the programming world but I found some tutorials I think would help you out with your python coding.
Coding in Python? I suggest you either read a Python book or go to codecademy.com and take a Python course. After you know some Python, I suggest you could make some mini projects.
Do you want to learn python? You can check out my programming youtube channel https://www.youtube.com/channel/UCIta8OqsKjfE1knTU2DJlSQ?disable_polymer=true. Python Intermediate, Beginner, and Advanced content. Please subscribe if you like it.
Or, do you need help with code, just copy and paste below if you need that.