It looks like you're new here. If you want to get involved, click one of these buttons!
print \"hello\"
a= 123456789
print a
a=raw_input(\"Enter some text. \")
print a
a=int(raw_input(\" Enter a number \"))
b=int(raw_input(\"Enter another number .\"))
print a+b
this allows the coder to allow the user to do something like multiply divide add or subtract a number they input.
b = \"loasdaoaflksfljhsdf\"
if b==b:
print \"b is equal to b\"
else:
print \"b is not equal to be\"
or it can be used with elif statements
a = raw_input(\" Enter Some Text: \")
b = len(a)
if b==\"1\":
print \"b is equal to 1\"
elif b==2:
print \"b is equal to 2\"
elif b==3:
print \"b is equal to 3\"
else:
print \"b is greater than 3\"
a = 1234436546786785694567234623452345\"
b = len(a)
print b
quit
quit()
So here are some basics that should get you started.
1. print. print can be used in 2 ways.print \"hello\"
anda= 123456789
print a
Note that "a" is not in quotations as it is a variable.
2. raw_input("insert text here "). raw_input allows the user to input into the code a use would be.a=raw_input(\"Enter some text. \")
print a
this code would print whatever the user inputed.
3.in(raw_input("insert number here")). this is the same as raw_input however instead of text it is specifically for numbers an example would be.
a=int(raw_input(\" Enter a number \"))
b=int(raw_input(\"Enter another number .\"))
print a+b
this allows the coder to allow the user to do something like multiply divide add or subtract a number they input.
4. if, else and elif. if, else and elif are conditions. they are used in the following way.b = \"loasdaoaflksfljhsdf\"
if b==b:
print \"b is equal to b\"
else:
print \"b is not equal to be\"
or it can be used with elif statementsa = raw_input(\" Enter Some Text: \")
b = len(a)
if b==\"1\":
print \"b is equal to 1\"
elif b==2:
print \"b is equal to 2\"
elif b==3:
print \"b is equal to 3\"
else:
print \"b is greater than 3\"
5. len. len will tell you the length of the string that is in the brackets after it with it be (a) or ("1235665674576").
it would be used as.a = 1234436546786785694567234623452345\"
b = len(a)
print b
6. quit. this will exit the script. it can be used as.
quit
orquit()
I hope this has helped or gave some people something to start to learn python off.