-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic_python.py
More file actions
155 lines (99 loc) · 4.74 KB
/
Basic_python.py
File metadata and controls
155 lines (99 loc) · 4.74 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# SUN NOV 26 1:00
# Hello, I will help you understand basic python (It really basic)
# We will understand print() # Example 1, input() #Example 1 and #Example 2, list = , if, elif and else
# CREATED BY angelandidkw ((GITHUB)
#----------------------------------------------------------------------------------------------------------------------#
#Print the basic
# print("Hello world")
# Output should be - Hello world -
# One thing is important is don't forget to put ""
# IF you don't active the function using "" **It will show a error**
#Example 1
# print("Hello, Coding class!") # OUTPUT - Hello, Coding class
# print("My name is ******") # OUTPUT - My name is ******
# Quiz
# I want you print your name and why you are learning python!
# CREATED BY angelandidkw (GITHUB)
#----------------------------------------------------------------------------------------------------------------------#
# CREATED BY angelandidkw ( GITHUB1 )
# User input
# ver is veriable using = to assign the ver and it reference input
# ver = input("Hello, What is your name?") # OUTPUT - Hello, What is your name? [] <-- user input
# THIS IS THE CODE ^^^ you can delete the hash to active the function
# user_input = input("This is like print functions")
# Example 1
# I will be using if and else statement if you don't understand go to if and elif statment or go to example 2
# question = input("Would you like to play?")
# THIS IS THE CODE ^^^ you can delete the hash to active the function
# Im making if statment to check the statement
# if question == "yes" or question == "Yes":
# print("Alright") # if user said Yes or yes it will print "alright"
# else:
# print("Alright I have nice day!") # else going print "Alright I have nice day!"
#Example 2
# user = input("Usermame ===> ") # Asking a user put username
# print("Login works!") # print the function after function is done asking the input 2
# Quiz time!
# I want you create two input one username and one password and after username print Login works
# After password print password works
# output Username:
# Login works
# Password:
# password works
# CREATED BY angelandidkw ( GITHUB )
#----------------------------------------------------------------------------------------------------------------------#
# Creating list
# choose_a_veriable_of_your_choice = ("Mark", "Zack", "Miranda", "Zack", "Mary")
# choose_a_veriable_of_your_choice_1 = ["Mark", "Zack", "Miranda", "Zack", "Mary"]
# print(choose_a_veriable_of_your_choice) # Output: ('Mark', 'Zack', 'Miranda', 'Zack', 'Mary')
# print(choose_a_veriable_of_your_choice_1) # Output: ['Mark', 'Zack', 'Miranda', 'Zack', 'Mary']
# first we are choosing any veriable then making list using () or [] then we are printing veriable because it reference the list
# Example 1
# We are going call a veriable like mark
#x = ("Mark", "Zack", "Miranda", "Zack", "Mary")
#print(x[0]) # The reason we 0 because in list has numbers
#0 #1 #2 #3 #4
# "Mark" "Zack" "Miranda" "Zack" "Mary"
#List of Numbers:
#numbers = [1, 2, 3, 4, 5]
#List of Strings:
#fruits = ["apple", "banana", "orange", "grape"]
#List of Mixed Types:
#mixed_list = [1, "hello", 3.14, True]
#List of Lists (Nested Lists):
#nested_list = [[1, 2, 3], ["a", "b", "c"], [True, False]]
#List of Tuples:
#coordinates = [(1, 2), (3, 4), (5, 6)]
#
#List of Boolean Values:
#boolean_values = [True, False, True, True, False]
#
#List of Dictionaries:
#students = [
# {"name": "Alice", "age": 25, "grade": "A"},
# {"name": "Bob", "age": 22, "grade": "B"},
# {"name": "Charlie", "age": 24, "grade": "A"}
#]
#Empty List:
#empty_list = []
# There is whole lot what you can do with list but I can't through all of type list :)
# CREATED BY angelandidkw ( GITHUB )
#----------------------------------------------------------------------------------------------------------------------#
# if,elif,else keywords
# Code to be executed if condition1 is true
#if condition1:
#elif condition2:
# Code to be executed if condition2 is true
#else:
# Code to be executed if none of the conditions are true
#username = input("Enter username: ")
#if username == "mark": # first going see username what did user input now if username is true or same as "mark" it is going print Welcome mark
# print("Welcome mark")
#elif username == "Zack": # If don't match mark but if it did match Zack going to say print Welcome Zach
# print("Welcome Zach")
#else:
# print("Welcome!") # Lastly if confition is not true it is going here else going print "Welcome "
# There lot more that you could with if, elif, else but I'm showing the basic and general basic
# Thank you
# CREATED BY angelandidkw
# GITHUB ACC: angelandidkw