fpythons 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. fpythons/__init__.py +12 -0
  2. fpythons/__main__.py +4 -0
  3. fpythons/data/00_START_HERE.md +144 -0
  4. fpythons/data/ALL_SLIPS_CODE.txt +1854 -0
  5. fpythons/data/README.md +35 -0
  6. fpythons/data/Slip_01.md +160 -0
  7. fpythons/data/Slip_02.md +104 -0
  8. fpythons/data/Slip_03.md +95 -0
  9. fpythons/data/Slip_04.md +131 -0
  10. fpythons/data/Slip_05.md +120 -0
  11. fpythons/data/Slip_06.md +161 -0
  12. fpythons/data/Slip_07.md +121 -0
  13. fpythons/data/Slip_08.md +95 -0
  14. fpythons/data/Slip_09.md +92 -0
  15. fpythons/data/Slip_10.md +113 -0
  16. fpythons/data/Slip_11.md +109 -0
  17. fpythons/data/Slip_12.md +181 -0
  18. fpythons/data/Slip_13.md +163 -0
  19. fpythons/data/Slip_14.md +141 -0
  20. fpythons/data/Slip_15.md +100 -0
  21. fpythons/data/Slip_16.md +127 -0
  22. fpythons/data/Slip_17.md +93 -0
  23. fpythons/data/Slip_18.md +96 -0
  24. fpythons/data/Slip_19.md +94 -0
  25. fpythons/data/Slip_20.md +165 -0
  26. fpythons/data/Slip_21.md +122 -0
  27. fpythons/data/VIVA.md +195 -0
  28. fpythons/data/code/slip1/.gitignore +2 -0
  29. fpythons/data/code/slip1/package.json +31 -0
  30. fpythons/data/code/slip1/public/index.html +12 -0
  31. fpythons/data/code/slip1/src/App.js +7 -0
  32. fpythons/data/code/slip1/src/index.js +10 -0
  33. fpythons/data/code/slip1/src/slip1/loginForm.js +26 -0
  34. fpythons/data/code/slip1/src/slip1/style.css +46 -0
  35. fpythons/data/code/slip10/.gitignore +2 -0
  36. fpythons/data/code/slip10/package.json +31 -0
  37. fpythons/data/code/slip10/public/index.html +12 -0
  38. fpythons/data/code/slip10/src/App.js +7 -0
  39. fpythons/data/code/slip10/src/index.js +10 -0
  40. fpythons/data/code/slip10/src/slip10/SumOfDigits.js +37 -0
  41. fpythons/data/code/slip11/.gitignore +2 -0
  42. fpythons/data/code/slip11/package.json +31 -0
  43. fpythons/data/code/slip11/public/index.html +12 -0
  44. fpythons/data/code/slip11/src/App.js +7 -0
  45. fpythons/data/code/slip11/src/index.js +10 -0
  46. fpythons/data/code/slip11/src/slip11/StringOperation.js +33 -0
  47. fpythons/data/code/slip12/.gitignore +2 -0
  48. fpythons/data/code/slip12/package.json +33 -0
  49. fpythons/data/code/slip12/public/index.html +12 -0
  50. fpythons/data/code/slip12/src/App.js +7 -0
  51. fpythons/data/code/slip12/src/index.js +14 -0
  52. fpythons/data/code/slip12/src/slip12/NotesManagementApp.js +35 -0
  53. fpythons/data/code/slip12/src/slip12/redux/notesSlice.js +20 -0
  54. fpythons/data/code/slip12/src/slip12/redux/store.js +10 -0
  55. fpythons/data/code/slip13/.gitignore +2 -0
  56. fpythons/data/code/slip13/package.json +33 -0
  57. fpythons/data/code/slip13/public/index.html +12 -0
  58. fpythons/data/code/slip13/src/App.js +7 -0
  59. fpythons/data/code/slip13/src/index.js +14 -0
  60. fpythons/data/code/slip13/src/slip13/Counter.js +20 -0
  61. fpythons/data/code/slip13/src/slip13/redux/counterSlice.js +19 -0
  62. fpythons/data/code/slip13/src/slip13/redux/store.js +10 -0
  63. fpythons/data/code/slip14/.gitignore +2 -0
  64. fpythons/data/code/slip14/package.json +31 -0
  65. fpythons/data/code/slip14/public/index.html +12 -0
  66. fpythons/data/code/slip14/src/App.js +7 -0
  67. fpythons/data/code/slip14/src/index.js +10 -0
  68. fpythons/data/code/slip14/src/slip14/Calculator.js +64 -0
  69. fpythons/data/code/slip15/.gitignore +2 -0
  70. fpythons/data/code/slip15/package.json +31 -0
  71. fpythons/data/code/slip15/public/index.html +12 -0
  72. fpythons/data/code/slip15/src/App.js +7 -0
  73. fpythons/data/code/slip15/src/index.js +10 -0
  74. fpythons/data/code/slip15/src/slip15/Counter.js +24 -0
  75. fpythons/data/code/slip16/.gitignore +2 -0
  76. fpythons/data/code/slip16/package.json +31 -0
  77. fpythons/data/code/slip16/public/index.html +12 -0
  78. fpythons/data/code/slip16/src/App.js +7 -0
  79. fpythons/data/code/slip16/src/index.js +10 -0
  80. fpythons/data/code/slip16/src/slip16/TraditionalDOM.html +24 -0
  81. fpythons/data/code/slip16/src/slip16/VirtualDOM.js +16 -0
  82. fpythons/data/code/slip17/.gitignore +2 -0
  83. fpythons/data/code/slip17/package.json +31 -0
  84. fpythons/data/code/slip17/public/index.html +12 -0
  85. fpythons/data/code/slip17/src/App.js +7 -0
  86. fpythons/data/code/slip17/src/index.js +10 -0
  87. fpythons/data/code/slip17/src/slip17/Sign-in.js +17 -0
  88. fpythons/data/code/slip18/.gitignore +2 -0
  89. fpythons/data/code/slip18/package.json +31 -0
  90. fpythons/data/code/slip18/public/index.html +12 -0
  91. fpythons/data/code/slip18/public/logo192.png +0 -0
  92. fpythons/data/code/slip18/src/App.js +7 -0
  93. fpythons/data/code/slip18/src/index.js +10 -0
  94. fpythons/data/code/slip18/src/slip18/Profile.js +20 -0
  95. fpythons/data/code/slip19/.gitignore +2 -0
  96. fpythons/data/code/slip19/package.json +31 -0
  97. fpythons/data/code/slip19/public/index.html +12 -0
  98. fpythons/data/code/slip19/src/App.js +7 -0
  99. fpythons/data/code/slip19/src/index.js +10 -0
  100. fpythons/data/code/slip19/src/slip19/Movies.js +19 -0
  101. fpythons/data/code/slip2/.gitignore +2 -0
  102. fpythons/data/code/slip2/package.json +31 -0
  103. fpythons/data/code/slip2/public/index.html +12 -0
  104. fpythons/data/code/slip2/src/App.js +7 -0
  105. fpythons/data/code/slip2/src/index.js +10 -0
  106. fpythons/data/code/slip2/src/slip2/useEffect.js +23 -0
  107. fpythons/data/code/slip20/.gitignore +2 -0
  108. fpythons/data/code/slip20/package.json +32 -0
  109. fpythons/data/code/slip20/public/index.html +12 -0
  110. fpythons/data/code/slip20/src/App.js +16 -0
  111. fpythons/data/code/slip20/src/index.js +10 -0
  112. fpythons/data/code/slip20/src/slip20/Login.js +45 -0
  113. fpythons/data/code/slip20/src/slip20/Students.js +27 -0
  114. fpythons/data/code/slip21/.gitignore +2 -0
  115. fpythons/data/code/slip21/package.json +31 -0
  116. fpythons/data/code/slip21/public/index.html +12 -0
  117. fpythons/data/code/slip21/src/App.js +7 -0
  118. fpythons/data/code/slip21/src/index.js +10 -0
  119. fpythons/data/code/slip21/src/slip21/NumberString.js +46 -0
  120. fpythons/data/code/slip3/.gitignore +2 -0
  121. fpythons/data/code/slip3/package.json +31 -0
  122. fpythons/data/code/slip3/public/index.html +12 -0
  123. fpythons/data/code/slip3/src/App.js +7 -0
  124. fpythons/data/code/slip3/src/index.js +10 -0
  125. fpythons/data/code/slip3/src/slip3/toggleBtn.js +16 -0
  126. fpythons/data/code/slip4/.gitignore +2 -0
  127. fpythons/data/code/slip4/package.json +32 -0
  128. fpythons/data/code/slip4/public/index.html +12 -0
  129. fpythons/data/code/slip4/src/App.js +23 -0
  130. fpythons/data/code/slip4/src/index.js +10 -0
  131. fpythons/data/code/slip4/src/slip4/About.js +7 -0
  132. fpythons/data/code/slip4/src/slip4/Contact.js +7 -0
  133. fpythons/data/code/slip4/src/slip4/home.js +7 -0
  134. fpythons/data/code/slip5/.gitignore +2 -0
  135. fpythons/data/code/slip5/package.json +32 -0
  136. fpythons/data/code/slip5/public/index.html +12 -0
  137. fpythons/data/code/slip5/src/App.js +18 -0
  138. fpythons/data/code/slip5/src/index.js +10 -0
  139. fpythons/data/code/slip5/src/slip5/loginValidation.js +30 -0
  140. fpythons/data/code/slip6/.gitignore +2 -0
  141. fpythons/data/code/slip6/package.json +32 -0
  142. fpythons/data/code/slip6/public/index.html +12 -0
  143. fpythons/data/code/slip6/src/App.js +31 -0
  144. fpythons/data/code/slip6/src/index.js +10 -0
  145. fpythons/data/code/slip6/src/slip6/Dashboard.js +12 -0
  146. fpythons/data/code/slip6/src/slip6/Login.js +23 -0
  147. fpythons/data/code/slip6/src/slip6/ProtectedRoute.js +10 -0
  148. fpythons/data/code/slip7/.gitignore +2 -0
  149. fpythons/data/code/slip7/package.json +31 -0
  150. fpythons/data/code/slip7/public/index.html +12 -0
  151. fpythons/data/code/slip7/src/App.js +7 -0
  152. fpythons/data/code/slip7/src/index.js +10 -0
  153. fpythons/data/code/slip7/src/slip7/TodoList.js +42 -0
  154. fpythons/data/code/slip8/.gitignore +2 -0
  155. fpythons/data/code/slip8/package.json +31 -0
  156. fpythons/data/code/slip8/public/index.html +12 -0
  157. fpythons/data/code/slip8/src/App.js +7 -0
  158. fpythons/data/code/slip8/src/index.js +10 -0
  159. fpythons/data/code/slip8/src/slip8/ToggleButton.js +19 -0
  160. fpythons/data/code/slip9/.gitignore +2 -0
  161. fpythons/data/code/slip9/package.json +31 -0
  162. fpythons/data/code/slip9/public/index.html +12 -0
  163. fpythons/data/code/slip9/src/App.js +7 -0
  164. fpythons/data/code/slip9/src/index.js +10 -0
  165. fpythons/data/code/slip9/src/slip9/Counter.js +16 -0
  166. fpythons/main.py +226 -0
  167. fpythons-0.1.0.dist-info/METADATA +64 -0
  168. fpythons-0.1.0.dist-info/RECORD +170 -0
  169. fpythons-0.1.0.dist-info/WHEEL +4 -0
  170. fpythons-0.1.0.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip19",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 19</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import Movies from './slip19/Movies';
2
+
3
+ function App() {
4
+ return <Movies />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,19 @@
1
+ import React from 'react'
2
+
3
+ const Movies = () => {
4
+
5
+ const movies = ['3 idiots', 'Bhag milkha bhag', 'Shershah', 'Amaran', 'Avengers', 'Drishyam', 'Golmaal', 'Singham', 'Mitwa', 'Timepass'];
6
+
7
+ return (
8
+ <div>
9
+ <h2>Favorite Movies List</h2>
10
+ <ul>
11
+ {movies.map((item, index) =>(
12
+ <li key={index}>{item}</li>
13
+ ))}
14
+ </ul>
15
+ </div>
16
+ )
17
+ }
18
+
19
+ export default Movies
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip2",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 2</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import UseEffect from './slip2/useEffect';
2
+
3
+ function App() {
4
+ return <UseEffect />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,23 @@
1
+ import React, { useState, useEffect } from 'react'
2
+
3
+ const UseEffect = () => {
4
+ const [users, setUsers] = useState([]);
5
+
6
+ useEffect(() =>{
7
+ fetch("https://jsonplaceholder.typicode.com/users")
8
+ .then(res => res.json())
9
+ .then(data =>{ setUsers(data);
10
+ console.log(data);
11
+ })
12
+ }, [])
13
+ return (
14
+ <div>
15
+ <h1>User List:</h1>
16
+ {users.map(user =>(
17
+ <p key={user.id}>{user.name}</p>
18
+ ))}
19
+ </div>
20
+ )
21
+ }
22
+
23
+ export default UseEffect
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "slip20",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-router-dom": "^7.18.7",
9
+ "react-scripts": "5.0.1"
10
+ },
11
+ "scripts": {
12
+ "start": "react-scripts start",
13
+ "build": "react-scripts build"
14
+ },
15
+ "eslintConfig": {
16
+ "extends": [
17
+ "react-app"
18
+ ]
19
+ },
20
+ "browserslist": {
21
+ "production": [
22
+ ">0.2%",
23
+ "not dead",
24
+ "not op_mini all"
25
+ ],
26
+ "development": [
27
+ "last 1 chrome version",
28
+ "last 1 firefox version",
29
+ "last 1 safari version"
30
+ ]
31
+ }
32
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 20</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,16 @@
1
+ import { BrowserRouter, Routes, Route } from 'react-router-dom';
2
+ import Login from './slip20/Login';
3
+ import Students from './slip20/Students';
4
+
5
+ function App() {
6
+ return (
7
+ <BrowserRouter>
8
+ <Routes>
9
+ <Route path="/" element={<Login />} />
10
+ <Route path="/user/:id" element={<Students />} />
11
+ </Routes>
12
+ </BrowserRouter>
13
+ );
14
+ }
15
+
16
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react';
2
+ import { useNavigate } from 'react-router-dom';
3
+
4
+ const Login = () => {
5
+
6
+ const [id, setId] = useState('');
7
+ const [username, setUsername] = useState('');
8
+ const [password, setPassword] = useState('');
9
+ const navigate = useNavigate();
10
+
11
+ const users = [
12
+ {id: 101, name: 'Asha'},
13
+ {id: 102, name: 'Rahul'},
14
+ {id: 103, name: 'Urmila'},
15
+ {id: 104, name: 'Satish'}
16
+ ];
17
+
18
+ const handleSubmit = (e) =>{
19
+ e.preventDefault();
20
+ const user = users.find((item) => item.id === Number(id));
21
+ if(user !== undefined && username === 'Admin' && password === '1234'){
22
+ navigate(`/user/${id}`);
23
+ }
24
+ else{
25
+ alert("Invalid credentials");
26
+ }
27
+ console.log("Id: ", id);
28
+ console.log("Username: ", username);
29
+ console.log("Password: ", password);
30
+ }
31
+
32
+ return (
33
+ <div>
34
+ <h2>Login Form</h2>
35
+ <form onSubmit={handleSubmit}>
36
+ <label>UserId<input type='text' value={id} onChange={(e) => setId(e.target.value)}></input></label><br></br>
37
+ <label>Username<input type='text' value={username} onChange={(e) => setUsername(e.target.value)}></input></label><br></br>
38
+ <label>Password<input type='password' value={password} onChange={(e) => setPassword(e.target.value)}></input></label><br></br>
39
+ <button type='submit'>Login</button>
40
+ </form>
41
+ </div>
42
+ )
43
+ }
44
+
45
+ export default Login
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import {useParams} from 'react-router-dom';
3
+
4
+ const Students = () => {
5
+
6
+ const {id} = useParams();
7
+ const users = [
8
+ {id: 101, name: 'Asha'},
9
+ {id: 102, name: 'Rahul'},
10
+ {id: 103, name: 'Urmila'},
11
+ {id: 104, name: 'Satish'}
12
+ ];
13
+
14
+ const user = users.find((item) => item.id === Number(id));
15
+
16
+ return (
17
+ <div>
18
+ {user ? (<div>
19
+ <h2>Student Id: {user.id}</h2>
20
+ <p>Student Name: {user.name}</p>
21
+ </div>
22
+ ) : (<h2>User not found</h2>)}
23
+ </div>
24
+ )
25
+ }
26
+
27
+ export default Students
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip21",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 21</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import NumberString from './slip21/NumberString';
2
+
3
+ function App() {
4
+ return <NumberString />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,46 @@
1
+ import React, { useState } from 'react';
2
+
3
+ const NumberString = () => {
4
+
5
+ const [number, setNumber] = useState('');
6
+ const [string, setString] = useState('');
7
+ const [numberResult, setNumberResult] = useState(null);
8
+ const [stringResult, setStringResult] = useState(null);
9
+
10
+ const EvenOdd = () =>{
11
+ if(Number(number) % 2 === 0){
12
+ setNumberResult("Even");
13
+ }else{
14
+ setNumberResult("Odd");
15
+ }
16
+ }
17
+
18
+ const checkPalindrome = () =>{
19
+ let str = string.split('').reverse().join('');
20
+ if(str === string){
21
+ setStringResult("Palindrome");
22
+ }else{
23
+ setStringResult("Not palidrome");
24
+ }
25
+ }
26
+
27
+ const handleSubmit = (e) =>{
28
+ e.preventDefault();
29
+ EvenOdd();
30
+ checkPalindrome();
31
+ }
32
+
33
+ return (
34
+ <div>
35
+ <form onSubmit={handleSubmit}>
36
+ <label>Enter number:<input type='text' value={number} onChange={(e) => setNumber(e.target.value)}></input></label>
37
+ <label>Enter string:<input type='text' value={string} onChange={(e) => setString(e.target.value)}></input></label>
38
+ <button type='submit'>Check</button>
39
+ </form>
40
+ <p>Number is {numberResult}</p>
41
+ <p>String is {stringResult}</p>
42
+ </div>
43
+ )
44
+ }
45
+
46
+ export default NumberString
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "slip3",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-scripts": "5.0.1"
9
+ },
10
+ "scripts": {
11
+ "start": "react-scripts start",
12
+ "build": "react-scripts build"
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "react-app"
17
+ ]
18
+ },
19
+ "browserslist": {
20
+ "production": [
21
+ ">0.2%",
22
+ "not dead",
23
+ "not op_mini all"
24
+ ],
25
+ "development": [
26
+ "last 1 chrome version",
27
+ "last 1 firefox version",
28
+ "last 1 safari version"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 3</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,7 @@
1
+ import ToggleBtn from './slip3/toggleBtn';
2
+
3
+ function App() {
4
+ return <ToggleBtn />;
5
+ }
6
+
7
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,16 @@
1
+ import React, { useState } from 'react'
2
+
3
+ const ToggleBtn = () => {
4
+ const [status, setStatus] = useState('ON');
5
+ function checkStatus(){
6
+ setStatus(status === 'ON' ? 'OFF' : 'ON');
7
+ }
8
+ return (
9
+ <div style = {{backgroundColor : status === 'ON' ? 'lightgreen' : 'lightcoral'}}>
10
+ <h2>{status}</h2>
11
+ <button onClick={checkStatus}>{status === 'ON' ? 'Turn OFF' : 'Turn ON'}</button>
12
+ </div>
13
+ )
14
+ }
15
+
16
+ export default ToggleBtn
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "slip4",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "dependencies": {
6
+ "react": "^19.3.1",
7
+ "react-dom": "^19.3.1",
8
+ "react-router-dom": "^7.18.7",
9
+ "react-scripts": "5.0.1"
10
+ },
11
+ "scripts": {
12
+ "start": "react-scripts start",
13
+ "build": "react-scripts build"
14
+ },
15
+ "eslintConfig": {
16
+ "extends": [
17
+ "react-app"
18
+ ]
19
+ },
20
+ "browserslist": {
21
+ "production": [
22
+ ">0.2%",
23
+ "not dead",
24
+ "not op_mini all"
25
+ ],
26
+ "development": [
27
+ "last 1 chrome version",
28
+ "last 1 firefox version",
29
+ "last 1 safari version"
30
+ ]
31
+ }
32
+ }
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>Slip 4</title>
7
+ </head>
8
+ <body>
9
+ <noscript>You need to enable JavaScript to run this app.</noscript>
10
+ <div id="root"></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,23 @@
1
+ import { BrowserRouter, Routes, Route, Link } from 'react-router-dom';
2
+ import Home from './slip4/home';
3
+ import About from './slip4/About';
4
+ import Contact from './slip4/Contact';
5
+
6
+ function App() {
7
+ return (
8
+ <BrowserRouter>
9
+ <Link to="/">Home</Link> |{' '}
10
+ <Link to="/about">About</Link> |{' '}
11
+ <Link to="/contact">Contact Us</Link>
12
+
13
+ <Routes>
14
+ <Route path="/" element={<Home />} />
15
+ <Route path="/about" element={<About />} />
16
+ <Route path="/contact" element={<Contact />} />
17
+ <Route path="*" element={<h1>Page Not Found!</h1>} />
18
+ </Routes>
19
+ </BrowserRouter>
20
+ );
21
+ }
22
+
23
+ export default App;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ root.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>
10
+ );
@@ -0,0 +1,7 @@
1
+ function About(){
2
+ return(
3
+ <h1>This is a About page.</h1>
4
+ )
5
+ }
6
+
7
+ export default About
@@ -0,0 +1,7 @@
1
+ function Contact(){
2
+ return(
3
+ <h1>Contact Us</h1>
4
+ );
5
+ }
6
+
7
+ export default Contact
@@ -0,0 +1,7 @@
1
+ function Home(){
2
+ return(
3
+ <h1>Hello, Welcome to the Home!</h1>
4
+ )
5
+ }
6
+
7
+ export default Home
@@ -0,0 +1,2 @@
1
+ node_modules/
2
+ build/