blind typing
cmd command => (path) color , dir, cls, python -V, python --version, cd , exit ,code, mkdir (md) | rd | (rmdir /s (delete with subdirectory)),|rename file.pe file.py|ren (rename file ) type(reads the files), | type nul > index.html (creates file) | echo print(5*5) > demo.py (writes a code inside the file) del(delete files), date,| time => use only as a admin | shutdown /s => 1 min to shutdown (/r | /l ) | shutdown /a => to abort the shutting down how to run in terminal python file;> python file.py /help
short cuts;
%temp% / %appdata%
.formats;
errors❤; syntax error; name error; TypeError; IndentationError; ValueError; indexerror; AttributeError; Logic error;
""" multi line comment """
ctrl + alt + n = run
myvar = 1; my_var = 2 #snake_case; _my_var = 3; myVar = 4 # camelCase MYVAR = 5 myvar6 = 6
$ = 3; & = 4; 3 = 6; 2myvar = "John"; my var = "John"; my-var = "John" #kebab-case;
a = "Hello" t = "python"; g = "juda"; b = "zo'r";
print(t +" " + g + " " + b);
input(); name = input("name?"); print(name, type(name));
a = 18 print(a,type(a))
data = input() #default #hint
print(data,type(data))
ctrl + shift + p
num = int(input()) print(num, type(num))
a = "Hello, World!" print(len(a))
a = "Hello, World!" print(a[1])
b = "Hello, World!" print(b[2:5])
b = "Hello, World!" print(b[:5])
b = "Hello, World!" print(b[2:])
b = "Hello, World!" print(b[-5:-2])
a="string" print(a.index("r"))
soz = input("Enter a string: ")
index = int(input("Enter a number: "))
print(soz[index])
a = "Hello, World!" print(a.upper())
a = "Hello, World!" print(a.lower())
b = "hello, world!" print(b.title()) > H W
b = "hello, world!" print(b.capitalize())
word = "salom MENING ISMIM teamit" print(word.swapcase())
b = "HELLO, WORLD!" print(b.casefold()) => advanced version of lower
a = "Hello, World!" print(a.strip())
print(a.lstrip()) print(a.rstrip())
a = "Hello, World!" print(a.replace("H", "J"))
b = "HELLOH, WORLD!" print(b.count("O"))
a = "Hello, World!" print(a.split(" "))
% a = "Hello, World!" % l = list(a) % print(l)
a = ['boom','boom','boom','boom',] print(a) print(*a)
#mutable & immutable
% list methods qop = ["apple", "banana", "cherry"]
---- tuple----- -Tuble listni elementlarini o'zgarimas ko'rinishi sifatida qabul qilish mmkn.
tuple1 = (33,55,66) tuple1[0] = 88 => type error chunki tuple qismlarini o'zgartirib bo'lmaydi (as a str)
# print("kiring")
#break & continue
return a
func(13)