HELIOPOLIS UNIVERSITY · BIOTECHNOLOGY · OAB 523

Mobile Virtual Lab

Lecture 6 · Functions & Modular Programming in Python

DNA Sequence AnalyzerMobile-firstGuided practice + real Python (online)
المعمل يعمل على الموبايل؛ ابدأ بتسجيل الاسم والرقم الجامعي، ثم نفّذ الأنشطة وأرسل تقرير النتيجة إلى المحاضر.
YOUR LAB IDENTITY

Welcome to Lecture 6

Instructor: Prof. Dr. Amr Mossad. This lab connects variables, if-statements and loops (Lecture 5) to reusable functions.

Your name, answers and progress are kept on this device until you share or download your report. No automatic collection takes place.

Your progress

Guided checkpoints0 / 4

Mini-quiz not submitted · 10 questions

4
Practice checkpoints
10
MCQs
~40
Minutes · lab time
The guided activities work without an internet connection after this page has loaded. The Run real Python option needs internet access on first launch.
CHECKPOINT 1 · 1 POINT

Why functions? Understand return

Compare the two functions below. Which lets another function reuse the calculated value?

def show_double(x):
    print(x * 2)

def get_double(x):
    return x * 2
Not attempted
CHECKPOINT 2 · 1 POINT

Build a temperature conversion function

Formula: F = C × 9/5 + 32. Use return to make the answer reusable.

def celsius_to_fahrenheit(c):
    return c * 9/5 + 32
98.6°F
Calculated using the function formula

Which pair matches the function's expected outputs?

Not attempted
CHECKPOINT 3 · 1 POINT

DNA Sequence Analyzer

Enter DNA made of A, C, G and T. The analyzer cleans spaces, converts lowercase letters to uppercase, validates the sequence, then calculates base frequencies.

Run a valid sequence and test an invalid sequence to complete this checkpoint.
–
Length (bases)
–
GC content (%)
–
AT content (%)

Validation rule: only a non-empty sequence of A/C/G/T is accepted. Demonstration only; GC% alone is not a biological diagnosis.

CHECKPOINT 4 · 1 POINT

Modular processing: several samples

Four demo samples are evaluated with the same reusable functions, rather than duplicating code.

Extend the analyzer

For ATGCGC, find AT% and the number of G bases.

Run the batch and answer both questions.
OPTIONAL · REAL PYTHON EXECUTION

Python code playground

This tab runs actual Python in your browser using Pyodide. Internet is required the first time to download Python; it can take longer on a mobile connection. The rest of the lab does not depend on it. Run real Python after this site is published; local file mode may block workers.

Ready to launch Python
Program output appears here.
Mobile tip: If Python does not load, continue with Practice, DNA Lab and Quiz; they remain fully functional. On a slow device, avoid very long loops.
10 QUESTIONS · 10 POINTS

Lecture 6 quick assessment

Select one answer per question. The score is saved on the device when you submit. A submitted quiz is locked unless the lab is reset.

Not submitted
LAB REPORT

Your submission receipt

Complete the activities, take the quiz, then prepare a receipt for your instructor.

0/4
Guided checkpoints
—/10
MCQ score
—/14
Total (formative)

A result file is not automatically delivered to the lecturer. You must send it or share the text yourself.

Submission preview

Please enter your name and student ID first.
بعد تنزيل النتيجة، أرسل ملف JSON إلى المحاضر أو انسخ ملخص النتيجة وأرسله على مجموعة المقرر. يمكن للمحاضر جمع ملفات JSON باستخدام صفحة Teacher Dashboard الموجودة بالحزمة.