Knowee
Questions
Features
Study Tools

Write a python code to find the year of joining of a student in vit from his/ her registration number. The first two digits of the registration number define the last two digits of the year. Concatenate it to 20 and find the whole year.Witout using function.

Question

Write a python code to find the year of joining of a student in vit from his/ her registration number. The first two digits of the registration number define the last two digits of the year. Concatenate it to 20 and find the whole year.Witout using function.

🧐 Not the exact question you are looking for?Go ask a question

Solution

Sure, here is a simple Python code snippet that does what you asked for:

# Let's assume the registration number is in the format "YYXXXXXX"
reg_no = input("Enter the registration number: ")

# Extract the first two digits
year_suffix = reg_no[:2]

# Concatenate it to "20"
year_of_joining = "20" + year_suffix

print("The year of joining is:", year_of_joining)

This code first takes the registration number as input from the user. It then extracts the first two digits from the registration number, which represent the last two digits of the year of joining. It then concatenates "20" to these two digits to get the full year of joining. Finally, it prints out the year of joining.

This problem has been solved

Similar Questions

In a school a class teacher wants to estimate age of the students in years, months and days. Date of birth will be given as input by the user in the format years-months-days. write a python program to estimate age of the student in the asked format. (Example: If the input is "1997-10-12", then the output of the program should be "26 years, 1 months, 13 days " )Input Format:Years-months-daysOutput Format:total years, total months, total days

Create a function that accepts a parameter / variable (input1) that will contain text. Count how many times a 4 digit year is mentioned in input1. Print the years in descending order alongwith how many times that year is mentioned in input1.* Example:input1 = "In the year 2005, a technological revolution set in motion changes that would ripple through time. By 2012, the seeds of innovation planted earlier blossomed into significant breakthroughs, propelling us into a new era. Now, in 2023, we stand on the threshold of another transformation, building upon the foundations set in past and enriched by the progress of 2023. As this year unfolds, it bears the promise of reshaping industries and lives, a testament to the continuous interplay of progress across different moments in time."* Expected Output:2012 appears 1 time(s)2023 appears 2 time(s)2005 appears 1 time(s)

7.Question 7Consider this code:12age1 = input("How old are you? ")age2 = input("How old is your best friend? ")The user enters the ages in years as whole numbers (e.g., 2). Select the code fragment(s) that print the sum of the ages. Be sure to use Python 3.1 pointprint(int(age1) + int(age2))print(int(age1) + int(age2))print(age1 + age2)print(age1 + age2)print(str(int(age1 + age2)))print(str(int(age1 + age2)))x = int(age1)x = int(age1)y = int(age2)y = int(age2)print(str(x + y))print(str(x + y))

A list named studentAge stores age of students of a class. Write thePython command to import the required module and (using built-infunction) to display the most common age value from the given list.

You are given a year in the form of an integer 'N', and your task is to check whether the given year is a leap year or not.Note:1) A year is said to be a leap year if it has 366 days. Normal years have 365 days.2) The integer 'N' does not contain any leading zeros.Sample Input 1:220002020Sample Output 1:YesYesExplanation for Sample Output 1:In test case 1, The year 2000 had 366 days since there were 29 days in the month of February in the year 2000.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.