Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ll21215/apt_exercises
  • hb09106/apt_exercises
  • afischer/apt_exercises
  • sm27496/apt2020
  • ia19390/apt_exercises
  • pk02862/apt_exercises
  • cd28198/apt_exercises
  • ma05240/apt_exercises
  • jp01114/apt_exercises
  • mf19908/apt_exercises
  • an25923/apt_exercises
  • ma18960/apt_exercises
  • fa30968/apt_exercises
  • jg08184/apt_exercises
  • gs27324/apt_exercises
  • ss18986/apt_exercises
16 results
Show changes
Commits on Source (5)
Showing
with 88 additions and 5 deletions
*.pyc
venv
b="00123456"
i=0
temp1=0
while i<len(b):
a=b[i]
a=int(a)
temp1=temp1+a
i+=1
print(temp1)
c=input("Please enter a number: ")
j=0
temp2=0
while j<len(c):
d=c[j]
d=int(d)
temp2=temp2+d
j+=1
print(temp2)
x=temp1-temp2
print("The difference is:", x)
def myfunc(values, value, next):
"""
This function will search an item in a list of values and return the neighbouring value -- either the successor or the predecessor.
"""
# First: find the position of value
i = -1
for j in range(len(values)):
v = values[j]
if v == value:
i = j
# If next == True get the successor
if next:
if i < len(values) - 1:
k = i + 1
return values[k]
else:
if i > 0:
l = i - 1
return values[l]
from django.shortcuts import render
# Create your views here.
......@@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path
urlpatterns = [
path('', admin.site.urls),
path('', include('university.urls')),
path('admin/', admin.site.urls),
]
<!DOCTYPE html>
<html lang="en">
<head>
<title>APT Django exercise</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="jumbotron text-center">
<h1>University</h1>
</div>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="/">Overview</a>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/professors">Professors</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/students">Students</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/exams">Exams</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin">Admin</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<h2>[[ Instead of this text, there should be the main content of the page ]]</h2>
</div>
</body>
</html>