-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.py
More file actions
33 lines (23 loc) · 875 Bytes
/
Copy pathvariables.py
File metadata and controls
33 lines (23 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Variable names must start with a letter or underscore.
validName = "Valid Name"
print(validName)
_anotherValidName = "Another Valid Name"
print(_anotherValidName)
# Variables cannot start with a number.
#1invalidName = "Invalid Name"
# Variables can only contain alpha-numeric characters and underscores (A-z, 0-9, and _)
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 = "all valid characters"
print(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890)
# Variables are case-sensitive
CaseSensitive = "Hello World!"
print(CaseSensitive)
caseSensitive = "This is not Hello World!"
print(caseSensitive)
# Variables do not need to be declared with any particular type and can even change type after they have been set.
numbers = 1
print(numbers)
while numbers < 10:
numbers = numbers + 1
print(numbers)
numbers = "Hello"
print(numbers)