CARVIEW |
Select Language
HTTP/1.1 200 OK
Date: Thu, 16 Oct 2025 03:25:52 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.33
Vary: Accept-Encoding
X-Powered-By: PHP/7.3.33
Set-Cookie: PHPSESSID=0f181c80954d1c2726cf20b29dce8fb3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-Pingback: https://geek-university.com/xmlrpc.php
Link: ; rel="https://api.w.org/"
Link: ; rel="alternate"; type="application/json"
Link: ; rel=shortlink
Content-Encoding: gzip
Referrer-Policy:
Content-Length: 15732
Content-Type: text/html; charset=UTF-8
Variable names | Python#
- CCNA online course
- Linux online course
- VMware ESXi online course
- Nmap online course
- MySQL online course
- Raspberry Pi online course
- Apache HTTP Server course
- VMware Player online course
- Splunk online course
- SQL online course
- Oracle VirtualBox online course
- Python online course
- Asterisk course
- VMware Workstation Player course
- Process Explorer course
- Pillow online course
- Create a web crawler in Python
- A short introduction to…
Variable names
There are couple of rules you need to be aware of when naming your variables:
1. you can use only letters, numbers, and underscores in variables names.
This is a valid variable name:
Name_1 = 'Tuna'
This is not:
Name;_1 = 'Tuna'
2. variable name can not start with a number:
Valid:
Name_1 = 'Tuna'
Invalid:
1_Name = 'Tuna'
3. spaces are not allowed in variable names (use underscores instead):
Valid:
first_name = 'Tuna'
Invalid:
first name = 'Tuna'
4. don’t use Python keywords and function names as variable names.
Invalid:
print = 'Tuna'
5. your variable names should be short and descriptive.
Valid:
first_name = 'Tuna'
Should not be used:
f_n = 'Tuna'
However, don’t go overboard. This would be an overkill:
first_name_of_a_person = 'Tuna'
6. variable names are case sensitive, e.g. these are two different variables:
first_name = 'Tuna' First_Name = 'Tuna'
Python course
- Introduction
- Python overview
- Install Python on Windows
- Install Python on Linux
- Add Python to the Windows Path
- Run Python code
- Interactive prompt
- IDLE editor
- Command line
- Help mode
- Basic programs
- Write your first program
- Use comments
- What are variables?
- Variable data types
- Variable names
- Numeric variables
- Strings
- Get the current date and time
- Operators overview
- Arithmetic operators
- Comparison operators
- Logical operators
- Assignment operators
- Membership operators
- Identity operators
- Conditional statements
- The if statement
- Get user input
- The if...else statement
- The if...elif statement
- Nested if statements
- Use logical operators
- Loops
- The for loop
- Use for loop with the range() function
- The break statement
- The continue statement
- The pass statement
- Use else statement in loops
- The while loop
- Nested loop statements
- Errors
- Types of errors
- Syntax and logical errors
- The try...except statements
- The try...except...else statements
- The try...except...finally statements
- Catch specific exceptions
- Raise exception
- Nest exception handling statements
- Modules
- What are modules?
- Import modules
- Find files on disk
- Display module content
- Strings
- What are strings?
- Escape characters
- Access individual characters
- String functions
- Search strings
- Concatenating strings
- Lists, sets, tuples, dictionaries
- What are lists?
- Modify lists
- Loop through a list
- Check whether a value is in a list
- Sorting lists temporarily
- Sorting lists permanently
- Obtaining the list length
- What are sets?
- What are dictionaries?
- Add new key-value pair to a dictionary
- Modify a value in a dictionary
- Delete a key-value pair in a dictionary
- Loop through a dictionary
- What are tuples?
- Looping over a tuple
- Working with files
- How to read and write files
- Read a file
- Read and write – with statement
- Make a list of lines from a file
- Functions
- What are functions?
- Return statement
- Positional arguments
- Keyword arguments
- Default values for parameters
- Flexible number of arguments
- Variable scopes