Information technology · Exam

Sample آزمون پایتون (سطح میانی)

۱۶ سؤال کدمحور درباره‌ی comprehension، برش رشته، مقدار پیش‌فرض تغییرپذیر، مولد، استثنا و کلاس — برای استخدام برنامه‌نویس، ۲۵ دقیقه.

19 questions · Free up to 50 responses a month

Print-ready Word and PDF files — free, no sign-up.

About this template

“آزمون پایتون (سطح میانی)” has 19 questions on 5 pages; every question is required. Question types: Single choice (16), Short text (1), National ID (1), Mobile number (1). Its sections, in order: «مشخصات شرکت‌کننده», «بخش ۱», «بخش ۲», «بخش ۳», «بخش ۴». 64 ready-made options across 16 choice questions, all editable in the online version.

In the online version of this template

  • National IDs are checked instantly with the check-digit algorithm.
  • Mobile numbers are validated against the Iranian number format.
  • Multiple-choice answers are graded automatically and each person's score is calculated.

مشخصات شرکت‌کننده

  1. 1.

    نام و نام خانوادگی *

    (Short text)
  2. 2.

    کد ملی *

    (National ID)
  3. 3.

    شماره موبایل *

    (Mobile number)

بخش ۱

  1. 4.

    خروجی print([x * 2 for x in range(4) if x % 2 == 0]) چیست؟ *

    (Single choice)
    • [0, 4]
    • [0, 2, 4, 6]
    • [2, 6]
    • [0, 2]
  2. 5.

    خروجی print({x: x ** 2 for x in (1, 2, 3)}[3]) چیست؟ *

    (Single choice)
    • 3
    • 6
    • 9
    • KeyError
  3. 6.

    پس از اجرای a = [1, 2, 3]; b = a; b.append(4)، خروجی print(len(a)) چیست؟ *

    (Single choice)
    • 3
    • 4
    • خطا
    • None
  4. 7.

    خروجی print('-'.join(['a', 'b', 'c'])) چیست؟ *

    (Single choice)
    • abc
    • -a-b-c-
    • ['a', 'b', 'c']
    • a-b-c
  5. 8.

    با تعریف def f(x, items=[]): items.append(x); return items، پس از فراخوانی f(1)، خروجی print(f(2)) چیست؟ *

    (Single choice)
    • [2]
    • [1, 2]
    • [1]
    • خطا

بخش ۲

  1. 9.

    خروجی print(list(map(lambda s: s.upper(), ['py', 'go']))) چیست؟ *

    (Single choice)
    • ['py', 'go']
    • ['Py', 'Go']
    • ['PY', 'GO']
    • PYGO
  2. 10.

    اجرای int('abc') کدام استثنا را ایجاد می‌کند؟ *

    (Single choice)
    • TypeError
    • ValueError
    • KeyError
    • SyntaxError
  3. 11.

    خروجی print(sorted(['banana', 'kiwi', 'apple'], key=len)) چیست؟ *

    (Single choice)
    • ['apple', 'banana', 'kiwi']
    • ['kiwi', 'apple', 'banana']
    • ['banana', 'apple', 'kiwi']
    • ['kiwi', 'banana', 'apple']
  4. 12.

    خروجی print(10 // 3, 10 % 3) چیست؟ *

    (Single choice)
    • 3 1
    • 3.33 1
    • 3 0
    • 4 1
  5. 13.

    خروجی print(type((1,)).__name__) چیست؟ *

    (Single choice)
    • int
    • list
    • tuple
    • set

بخش ۳

  1. 14.

    کدام کلیدواژه یک تابع را به «مولد» (generator) تبدیل می‌کند؟ *

    (Single choice)
    • return
    • async
    • lambda
    • yield
  2. 15.

    پس از s = {1, 2, 2, 3}، خروجی print(len(s)) چیست؟ *

    (Single choice)
    • 2
    • 3
    • 4
    • خطا
  3. 16.

    مزیت اصلی نوشتن with open('f.txt') as f: چیست؟ *

    (Single choice)
    • فایل را حتی اگر خطایی رخ دهد، خودکار می‌بندد
    • فایل را سریع‌تر می‌خواند
    • فایل را رمزگذاری می‌کند
    • از فایل یک نسخه‌ی پشتیبان می‌سازد
  4. 17.

    خروجی print('Python'[1:4]) چیست؟ *

    (Single choice)
    • Pyt
    • ytho
    • yth
    • tho
  5. 18.

    در متدهای یک کلاس، پارامتر self به چه اشاره می‌کند؟ *

    (Single choice)
    • خود کلاس
    • نمونه‌ی (شیء) فعلی کلاس
    • کلاس والد
    • ماژول جاری

بخش ۴

  1. 19.

    خروجی print(*[1, 2, 3], sep='|') چیست؟ *

    (Single choice)
    • [1, 2, 3]
    • 1 2 3
    • 1|2|3
    • |1|2|3|

Printable version (Word & PDF)

  • For filling in on paper, signing and filing by hand
  • Edit the Word file any way you like
  • Collecting and typing up the answers is up to you

Online version on Porsino

  • Answers are collected and organised automatically — no retyping
  • National ID, mobile number and dates are validated instantly
  • Ready-made reports and charts, plus Excel export in one click
  • Share a link or QR code — it works on mobile too

How do I use this template?

  1. Sign up for Porsino for free; no bank card needed.
  2. In the panel, open “Templates” and choose “آزمون پایتون (سطح میانی)”.
  3. Change the questions as you like, publish the form and send the link.
All Information technology templates