defentiionsprint()=show text on screen e.g. print("hi world")variable: A container that can hold a single word, number, or other infoe.g:
e.g. scoops_of_ice_cream=5print(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 storeString Data types:
Use "" with string data typesNumeric data types: numbers used in programoperators: symbol that perform a single type of action.Comparsion operators= produce bolean results and are e.g. bolean results: results that are yes and noLogical operators: Things important in all programming languages. logical operators in python:
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 codeprint(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 printCan u also please configure the settings to have a quality setting"""or """Seb W.V.Private Owned Corp.Example projectExample.py"""Debuging=fixed bugs or errors in the program.Random command= displays a random number. Needs to be importedcode: first input randomthen anywhere else in code random.randome.g. Input randomcargo=random.random()randge range= random coamand with a rangee.g. input randomrandom.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 inpute.g.guess=input(guess the number)casting: taking input and putting it into driffrent valuesint=abbrieation for a interger
¿Quieres crear tus propios Apuntes gratis con GoConqr? Más información.