Forwarded from Astu Coding
๐ แฅแซแ แจแแแฃแน แแแญ แซแ @astutechschat แแ แจแ
แตแฝแแแฝแแข
๐ แแณแฅแฃ แ แตแณแจแต / แแตแฐแซแจแ แ แแ แต แแตแแต แแแญ แซแ ๐ค @natiprado แแญ แแณแฐแญแฑแ แตแฝแแแฝแแข ๐
๐ แแณแฅแฃ แ แตแณแจแต / แแตแฐแซแจแ แ แแ แต แแตแแต แแแญ แซแ ๐ค @natiprado แแญ แแณแฐแญแฑแ แตแฝแแแฝแแข ๐
Sequence Data Types
๐ แ แ แญแฉ แญแ แจแณแณ แณแญแ แ แญแแตแฅ แจแฐแแซแฉ แณแณแแฝแ(แแฅแฎแฝแฃ แฝแแแฝ แแแฐ.) แ แแต แแญ แฐแฅแฐแฅ แ แตแจแแ แแแซแ แญแจแฑแแแข
๐ข แฅแแฐแจ แฃแแญแซแธแแ แ แแแแแณแธแ แ 3 แญแจแแแแฆ
1. List
2. Tuple
3. Set
๐ แ แ แญแฉ แญแ แจแณแณ แณแญแ แ แญแแตแฅ แจแฐแแซแฉ แณแณแแฝแ(แแฅแฎแฝแฃ แฝแแแฝ แแแฐ.) แ แแต แแญ แฐแฅแฐแฅ แ แตแจแแ แแแซแ แญแจแฑแแแข
๐ข แฅแแฐแจ แฃแแญแซแธแแ แ แแแแแณแธแ แ 3 แญแจแแแแฆ
1. List
2. Tuple
3. Set
List
๐ แญแ แ แจแณแณ แ แญแแต แแแแ แญ [ ] ๐ แญแแ แ แแ แฅแแ แแแแแข
แจแแจแฐแแตแ แฃแแญแญ แ แแแฆ
โ๏ธ Mutableแฆ แ แแแแแ แแ แแตแก แซแแตแ แณแณแแฝแฅ แแฅแแตแฃ แ แฒแต แแจแแญแฃ แแแจแญแฃ แแแแฅ แฅแแฝแแแแข
โ๏ธ Orderedแฆ แแญ แฅแแฐแฐแแ แจแฅ แ แฐแ-แฐแจแฐแแ แณแญแแแฅ แญแแแฃแแข
โ๏ธ Indexableแฆ แแตแก แซแแต แณแณแแฝ แจแแแแแแแ Access แแตแจแ แญแปแแแข
๐ แญแ แ แจแณแณ แ แญแแต แแแแ แญ [ ] ๐ แญแแ แ แแ แฅแแ แแแแแข
แจแแจแฐแแตแ แฃแแญแญ แ แแแฆ
โ๏ธ Mutableแฆ แ แแแแแ แแ แแตแก แซแแตแ แณแณแแฝแฅ แแฅแแตแฃ แ แฒแต แแจแแญแฃ แแแจแญแฃ แแแแฅ แฅแแฝแแแแข
โ๏ธ Orderedแฆ แแญ แฅแแฐแฐแแ แจแฅ แ แฐแ-แฐแจแฐแแ แณแญแแแฅ แญแแแฃแแข
โ๏ธ Indexableแฆ แแตแก แซแแต แณแณแแฝ แจแแแแแแแ Access แแตแจแ แญแปแแแข
ls = [1, 2, 3, 4, 5]
print(ls) # [1, 2, 3, 4, 5]
Indexing
๐ Indexing แแแตแฆ แจแแแแแแแ แณแณ แจแแตแก แ แแฅแถ แแ แแ แแแต แแแข
โ แจแแแ แแแ แ แแแแชแซ แแตแณแฝแแ แซแแ แแ แต แฐแแแแญ แแญ [แจIndex แแฅแญ] แ แแตแจแ แแแข
๐ข Index Number(แแฅแญ)แฆ แแแต แฅแ List แแตแฅ แแ แแฅแซแแณแแฑ แ แฃแแต แจแแฐแฅ แฐแซ แแฅแญ(แ แฐแ แฐแจแฐแแ แจแ แ แ) แแฅแญ แแแข
๐ Index Number แแแแ แจ0 แญแแแซแแข
แแแณแแฆ
แฅแแ แแตแต แฅแแแฅแญแฅ
แจIndex แแฅแซแธแ แจแจแณแฝ แซแแ แญแแแแข
0 1 2 3 4 ๐ Index Number
[6, 3, 1, 7, 2] ๐ List
แตแแแ แ แแ แจแแ แแตแฅ 7 แแฅแญแ แแแแ แฅ แฅแแญแญ แจแแจแฐแแแ แฅแ แแแแแข
Indexing แ แแต แจแแตแฑแ แ แฃแ แฅแป แณแญแแ 2แฃ 3แฃ แแแแฃแต แแแแฃ แแแแฃแต แ แจ แแแต แฅแญแแแแฃ แแแแฃแต แแแแ แแแแแ แฅ แญแจแฑแแแข
แ แแแ แแ แแตแฅ แ แฐแจแแชแแต แจแแ แแ แฐแแ แแแต แแฅแฅ(:)(Colon) แจIndex แแฅแญ แ แ แแฅ แ แแตแแแฅ แแแข
Structure:
[start:end:step]
แแแณแ
๐ข แฅแแแฒแ แแ แแแแชแซ แแญ แซแแ Index แแฅแฉ 0 แแ แซแแแค แแจแจแป แแญ แซแแ แฐแแ -1 แ แแต แแแข (แแฐ แแแ แญแแฅแซแ)
๐ Indexing แแแตแฆ แจแแแแแแแ แณแณ แจแแตแก แ แแฅแถ แแ แแ แแแต แแแข
โ แจแแแ แแแ แ แแแแชแซ แแตแณแฝแแ แซแแ แแ แต แฐแแแแญ แแญ [แจIndex แแฅแญ] แ แแตแจแ แแแข
๐ข Index Number(แแฅแญ)แฆ แแแต แฅแ List แแตแฅ แแ แแฅแซแแณแแฑ แ แฃแแต แจแแฐแฅ แฐแซ แแฅแญ(แ แฐแ แฐแจแฐแแ แจแ แ แ) แแฅแญ แแแข
๐ Index Number แแแแ แจ0 แญแแแซแแข
แแแณแแฆ
ls = [6, 3, 1, 7, 2]
แฅแแ แแตแต แฅแแแฅแญแฅ
แจIndex แแฅแซแธแ แจแจแณแฝ แซแแ แญแแแแข
0 1 2 3 4 ๐ Index Number
[6, 3, 1, 7, 2] ๐ List
แตแแแ แ แแ แจแแ แแตแฅ 7 แแฅแญแ แแแแ แฅ แฅแแญแญ แจแแจแฐแแแ แฅแ แแแแแข
ls = [6, 3, 1, 7, 2]
print(ls[3]) # 7
print(ls[0]) # 6
print(ls[1]) # 3
Indexing แ แแต แจแแตแฑแ แ แฃแ แฅแป แณแญแแ 2แฃ 3แฃ แแแแฃแต แแแแฃ แแแแฃแต แ แจ แแแต แฅแญแแแแฃ แแแแฃแต แแแแ แแแแแ แฅ แญแจแฑแแแข
แ แแแ แแ แแตแฅ แ แฐแจแแชแแต แจแแ แแ แฐแแ แแแต แแฅแฅ(:)(Colon) แจIndex แแฅแญ แ แ แแฅ แ แแตแแแฅ แแแข
Structure:
[start:end:step]
แแแณแ
print(ls[0: 2]) # [6, 3]
print(ls[1: 4]) # [3, 1, 7]
๐ข แฅแแแฒแ แแ แแแแชแซ แแญ แซแแ Index แแฅแฉ 0 แแ แซแแแค แแจแจแป แแญ แซแแ แฐแแ -1 แ แแต แแแข (แแฐ แแแ แญแแฅแซแ)
print(ls[-1]) # 2
๐
แแ แฅแแ [:] แฅแแฐแญแ แฐแแแฅ แแแแ แฅแแฐแแแณแฝแ แแแข
แ แ แญแฉ แญแแแ แญแแตแแ แ แ แซแฉ
โ๏ธ ls[0: 2] ๐ แจ0-2 (แแแตแ แ แซแซแตแตแ)
โ๏ธ ls[2: ] ๐ แจแแแต แฐแแฎ แแแแ
โ๏ธ ls[::2] ๐ แแแแ แแ แ แจ แแแต แฅแญแแ
โ๏ธ ls[::-1] ๐ แแแแ แจแแจแจแป แแแฎ
โ๏ธ ls[::-2] ๐ แแแแ แจแแจแจแป แแแฎ แ แจ แแแต แฅแญแแแข
โ แแแแ แจIndexing แฅแ แแฅ Index แแฅแญ แฐแ แ แแ แจแแแแแแแ แณแณ แแแจแญ แ แแซแ แแฅแแต แฅแแฝแแแแข
แแแแจแญ แตแแแแแฆ
ls[index number] = new value
แแแฅแแตแฆ
del ls[index number]
ใฝ๏ธ del แจแแญแฐแ Keyword แแแข
๐ก แตแแ แจIndex แแฅแญ = แฅแแณแธแ - 1
แ แ แญแฉ แญแแแ แญแแตแแ แ แ แซแฉ
โ๏ธ ls[0: 2] ๐ แจ0-2 (แแแตแ แ แซแซแตแตแ)
โ๏ธ ls[2: ] ๐ แจแแแต แฐแแฎ แแแแ
โ๏ธ ls[::2] ๐ แแแแ แแ แ แจ แแแต แฅแญแแ
โ๏ธ ls[::-1] ๐ แแแแ แจแแจแจแป แแแฎ
โ๏ธ ls[::-2] ๐ แแแแ แจแแจแจแป แแแฎ แ แจ แแแต แฅแญแแแข
โ แแแแ แจIndexing แฅแ แแฅ Index แแฅแญ แฐแ แ แแ แจแแแแแแแ แณแณ แแแจแญ แ แแซแ แแฅแแต แฅแแฝแแแแข
แแแแจแญ แตแแแแแฆ
ls[index number] = new value
แแแฅแแตแฆ
del ls[index number]
ใฝ๏ธ del แจแแญแฐแ Keyword แแแข
ls[0] = 1
print(ls) # [1, 3, 1, 7, 2]
ls[:3] = [0, 2, 3]
print(ls) # [0, 2, 3, 7, 2]
del ls[-1]
print(ls) # [0, 2, 3, 7]
๐ก แตแแ แจIndex แแฅแญ = แฅแแณแธแ - 1
๐3
Forwarded from Astu Techs
แ แชแฒแฎ แแญแต แฅแแฒแ แฅแแแฅแ?
Final Results
89%
แ แชแฒแฎ
11%
แฅแแฒแ
๐1
Forwarded from Astu Techs
๐ แจแฅแแแ แแแซ แ แชแฒแฎ แญแ แซแแ แจแแ แแแข
โ แฅแแ แ แฐแปแแ แ แ แ แจแแ แแแฎ แ แชแฒแฎ แฐแญแผ แฅแแ แ แ แฎแฒแแ แปแแ แแญ แฅแแแแแแข
โ ๏ธ แฅแตแจแแ แตแจแต แผแญ แแตแจแ แฅแแณแญแฐแซ๐
@astutechs
โ แฅแแ แ แฐแปแแ แ แ แ แจแแ แแแฎ แ แชแฒแฎ แฐแญแผ แฅแแ แ แ แฎแฒแแ แปแแ แแญ แฅแแแแแแข
โ ๏ธ แฅแตแจแแ แตแจแต แผแญ แแตแจแ แฅแแณแญแฐแซ๐
@astutechs
๐1
Media is too big
VIEW IN TELEGRAM
โช๏ธList Methods
โ append
โ extend
โ insert
โ pop
โ remove
ใฝ๏ธ แจแชแฒแฎแ แฅแซแต แจแแจแฐแ แณแญแ แตแแฐแแแฐ แแแข
๐ฅ 15 แฐแแ
๐พ 19 MB
โ append
โ extend
โ insert
โ pop
โ remove
ใฝ๏ธ แจแชแฒแฎแ แฅแซแต แจแแจแฐแ แณแญแ แตแแฐแแแฐ แแแข
๐ฅ 15 แฐแแ
๐พ 19 MB
Forwarded from Astu Techs
แแญแฐแ แแ แตแแ
แญแต แแฌ แแณ 3 แฐแแต แแญ Live voice chat แญแ แฅแแแข
@astutechs
@astutechs
๐2
Astu Coding
Dictionary @astucoding
โ ๏ธ แจแแญแฐแ 3.6 แ แแต แจแแ แจแ Dictionaryแฅ Unordered Dictionary แแ แญแข
๐ แแญแฐแ แแตแฅ Dictionary Ordered แจแแแ แจ3.6 version แ แแ แแแข
๐ แแญแฐแ แแตแฅ Dictionary Ordered แจแแแ แจ3.6 version แ แแ แแแข
แฐแแ
๐ Welcome to C++!
๐ แฅแแณแ แแฐ C++ แ แฐแ แ แแก!
๐ One of the most popular programming languages! ๐ แจแแฐแ แฐแแณแ แแต แแญแ แณแแแแต แซแแธแ แแฎแแซแ แ แแแ แแแแแฝ แ แแฑ แแแข
๐ฎ๐น๏ธ Builds games, operating systems, browsers, & more! ๐ฎ๐น๏ธ
โ Great for handling massive data & efficient resource use! โ C++ แตแแ แฅแ แ แฅแ แแจแ แแตแฐแแแต แฅแ แแฅแตแ แ แฅแแต แแ แแ แแ! โจ
๐ค๐ช๐ฉ๐ฅ๐ช๐ฉ
Most computer programs produce outputs. | แ แฅแแแน แจแฎแแแแฐแญ แแฎแแซแแฝ แแคแต แซแแแซแแข
Examples:
- "You've got mail!" notifications โ๏ธ | - "แ แฒแต แแแแญแต แฐแญแถแแ!" แจแแ แแณแแแซ โ๏ธ
- "Game Over" on screen ๐ฎ
- Account balance in banking app ๐ฐ | - แจแฃแแญ แแช แแณแฅ ๐ฐ
Simplest output: displaying a message onscreen.
Coders use outputs to check code & fix problems. | แแฎแแซแแฎแฝ แฎแต แแแจแแแฅ แฅแ แฝแแฎแฝแ แแแตแฐแซแจแ แแคแถแฝแ แญแ แแแแข
ะฮงฮะฮกโะ
cout << "Welcome to C++";
This is used to display the text welcome to c++ to the screen
๐ Welcome to C++!
๐ แฅแแณแ แแฐ C++ แ แฐแ แ แแก!
๐ One of the most popular programming languages! ๐ แจแแฐแ แฐแแณแ แแต แแญแ แณแแแแต แซแแธแ แแฎแแซแ แ แแแ แแแแแฝ แ แแฑ แแแข
๐ฎ๐น๏ธ Builds games, operating systems, browsers, & more! ๐ฎ๐น๏ธ
โ Great for handling massive data & efficient resource use! โ C++ แตแแ แฅแ แ แฅแ แแจแ แแตแฐแแแต แฅแ แแฅแตแ แ แฅแแต แแ แแ แแ! โจ
๐ค๐ช๐ฉ๐ฅ๐ช๐ฉ
Most computer programs produce outputs. | แ แฅแแแน แจแฎแแแแฐแญ แแฎแแซแแฝ แแคแต แซแแแซแแข
Examples:
- "You've got mail!" notifications โ๏ธ | - "แ แฒแต แแแแญแต แฐแญแถแแ!" แจแแ แแณแแแซ โ๏ธ
- "Game Over" on screen ๐ฎ
- Account balance in banking app ๐ฐ | - แจแฃแแญ แแช แแณแฅ ๐ฐ
Simplest output: displaying a message onscreen.
Coders use outputs to check code & fix problems. | แแฎแแซแแฎแฝ แฎแต แแแจแแแฅ แฅแ แฝแแฎแฝแ แแแตแฐแซแจแ แแคแถแฝแ แญแ แแแแข
ะฮงฮะฮกโะ
cout << "Welcome to C++";
This is used to display the text welcome to c++ to the screen
Advantages of C++ ๐ (แจC++ แฅแ
แแฝ)
C++ offers several key benefits:
โข High Performance โก๏ธ (แจแแฐแ แ แแปแธแ): [As a compiled language, C++ offers exceptional speed and efficiency.]
โข Object-Oriented Programming (OOP) ๐งฑ : [OOP principles make large projects easier to manage and maintain.]
โข Standard Template Library (STL) ๐งฐ : [The STL provides ready-made algorithms and data structures for efficient coding.]
โข Platform Independence ๐ (แแตแจแญ แแปแแต): [C++ code, once compiled, can run on various platforms (with appropriate compilers).]
โข Large and Active Community ๐งโ๐ป (แตแแ แฅแ แแ แแ แ แจแฐแฅ): [A vast community provides ample support and resources.]
Disadvantages of C++ ๐ (แจC++ แแณแถแฝ)
Despite its strengths, C++ also presents challenges:
โข Steep Learning Curve ๐: [Its complexity can make it difficult for beginners.]
โข Verbose Syntax ๐: [Code can be lengthy and less readable.]
โข Error-Prone โ ๏ธ: [Low-level access to system resources increases the risk of errors.]
Interesting Facts About C++ โจ (แตแ C++ แ แตแฐแแ แฅแแแณแแฝ)
Here are some fun facts:
โข Name Origin (แจแตแ แ แแฃแฅ): [The "++" reflects its incremental evolution from C.]
โข Industry Dominance (แจแขแแฐแตแตแช แ แแญแแต): [C++ is a leading language for technical and commercial software.]
โข Essential Function (แ แตแแแ แฐแแฃแญ): [Every C++ program needs at least a main() function to run.]
If you have any idea comment suggestion feel free to write.
๐๐๐
C++ offers several key benefits:
โข High Performance โก๏ธ (แจแแฐแ แ แแปแธแ): [As a compiled language, C++ offers exceptional speed and efficiency.]
โข Object-Oriented Programming (OOP) ๐งฑ : [OOP principles make large projects easier to manage and maintain.]
โข Standard Template Library (STL) ๐งฐ : [The STL provides ready-made algorithms and data structures for efficient coding.]
โข Platform Independence ๐ (แแตแจแญ แแปแแต): [C++ code, once compiled, can run on various platforms (with appropriate compilers).]
โข Large and Active Community ๐งโ๐ป (แตแแ แฅแ แแ แแ แ แจแฐแฅ): [A vast community provides ample support and resources.]
Disadvantages of C++ ๐ (แจC++ แแณแถแฝ)
Despite its strengths, C++ also presents challenges:
โข Steep Learning Curve ๐: [Its complexity can make it difficult for beginners.]
โข Verbose Syntax ๐: [Code can be lengthy and less readable.]
โข Error-Prone โ ๏ธ: [Low-level access to system resources increases the risk of errors.]
Interesting Facts About C++ โจ (แตแ C++ แ แตแฐแแ แฅแแแณแแฝ)
Here are some fun facts:
โข Name Origin (แจแตแ แ แแฃแฅ): [The "++" reflects its incremental evolution from C.]
โข Industry Dominance (แจแขแแฐแตแตแช แ แแญแแต): [C++ is a leading language for technical and commercial software.]
โข Essential Function (แ แตแแแ แฐแแฃแญ): [Every C++ program needs at least a main() function to run.]
If you have any idea comment suggestion feel free to write.
๐๐๐
Other university's c++ exams
We will see them one by one ๐คซ๐คซ
Until that try by ur self ๐
We will see them one by one ๐คซ๐คซ
Until that try by ur self ๐
C++ Quiz is about to start 3....2.....1
Put ur answer in the comment section
1. Which of the following is the correct syntax to output "Hello World" in C++?
a.
b.
c.
d.
2. Is C++ an alias of C#?
a. True
b. False
3. How do you insert COMMENTS in C++ code?
a.
b.
c.
4. Which data type is used to create a variable that should store text?
a.
b.
c.
d.
5. How do you create a variable with the numeric value 5?
a.
b.
c.
d.
6. How do you create a variable with the floating-point number 2.8?
a.
b.
c.
d.
7. Which method can be used to find the length of a string?
a.
b.
c.
d.
Comment ๐๐๐๐
Put ur answer in the comment section
1. Which of the following is the correct syntax to output "Hello World" in C++?
a.
print ("Hello World");b.
cout << "Hello World";c.
Console.WriteLine("Hello World");d.
System.out.println("Hello World");2. Is C++ an alias of C#?
a. True
b. False
3. How do you insert COMMENTS in C++ code?
a.
# This is a commentb.
/* This is a commentc.
// This is a comment4. Which data type is used to create a variable that should store text?
a.
Txtb.
stringc.
Stringd.
myString5. How do you create a variable with the numeric value 5?
a.
num x = 5;b.
x = 5;c.
double x = 5;d.
int x = 5;6. How do you create a variable with the floating-point number 2.8?
a.
byte x = 2.8b.
int x = 2.8c.
x = 2.8d.
double x = 2.87. Which method can be used to find the length of a string?
a.
getLength()b.
len()c.
length()d.
getSize()Comment ๐๐๐๐