Apuntes
Python chapter 1/part 1

Contenido del apunte (3)
Página 1
defentiions
print()=show text on screen e.g. print("hi world")
variable: A container that can hold a single word, number, or other info
e.g:


e.g. scoops_of_ice_cream=5
print(scoops_of_ice_cream)

e.g. scoops="5 scoops for"
people="5,000 people"
print(scoops + people)
Data types=driffrents types of data that a varriable can store
String Data types:

Página 2
Use "" with string data types
Numeric data types: numbers used in program
operators: symbol that perform a single type of action.
Comparsion operators= produce bolean results and are e.g.
bolean results: results that are yes and no
Logical operators: Things important in all programming languages. logical operators in python:

Página 3
e.g. print(10 > 5 and 10 < 20) is true.
not operator eg: print(not(10>20))
single-line comments=lines of code that are not run in python and used with a #
e.g.
#debug code
print(HIYA)
Multi-line comments= used for more than one line. Can be used to explain and do headings for a program like Name, project name, last updated etc.
e.g.
"""
Can u please add the print stament to print
Can u also please configure the settings to have a quality setting
"""
or
"""
Seb W.V.
Private Owned Corp.
Example project
Example.py
"""
Debuging=fixed bugs or errors in the program.
Random command= displays a random number. Needs to be imported
code:
first input random
then anywhere else in code random.random
e.g.
Input random
cargo=random.random()
randge range= random coamand with a range
e.g.
input random
random.randrange(1,11)
range start range end(displays it number-1)
input=python's built in commands and can be used out of the box. Used to ask for user input
e.g.
guess=input(guess the number)
casting: taking input and putting it into driffrent values
int=abbrieation for a interger
Información
- Descripción
- nothing (Python) programming tech rocket Apunte sobre Python chapter 1/part 1, creado por yomum 21 el 17/07/2016.
- Creado por
- yomum 21
- Visitas
- 49
- Valoración