Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "what is your name: ho\n",
- "Your name is :ho\n",
- "what is your age: 89\n",
- "ho happy 100 2028\n"
- ]
- }
- ],
- "source": [
- "name=input(\"what is your name: \")\n",
- "print( \"Your name is :\" +name)\n",
- "age=int(input(\"what is your age: \"))\n",
- "year=str((2017-age)+100)\n",
- "print(name+\" happy 100 \" +year)\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "[1, 2, 3, 4]\n"
- ]
- }
- ],
- "source": [
- "a=[1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10]\n",
- "i=int(5)\n",
- "new_list=[]\n",
- "for k in a :\n",
- " if k<i: new_list.append(k)\n",
- " \n",
- "print(new_list)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "1lZf4%RL\n"
- ]
- }
- ],
- "source": [
- "\n",
- "import random\n",
- "\n",
- "import1 = \"abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?\"\n",
- "passlength = 8\n",
- "p = \"\".join(random.sample(import1,passlength ))\n",
- "print(p)"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.6.1"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
- }
Add Comment
Please, Sign In to add comment