Guest User

Untitled

a guest
Oct 23rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 2,
  6. "metadata": {},
  7. "outputs": [
  8. {
  9. "name": "stdout",
  10. "output_type": "stream",
  11. "text": [
  12. "what is your name: ho\n",
  13. "Your name is :ho\n",
  14. "what is your age: 89\n",
  15. "ho happy 100 2028\n"
  16. ]
  17. }
  18. ],
  19. "source": [
  20. "name=input(\"what is your name: \")\n",
  21. "print( \"Your name is :\" +name)\n",
  22. "age=int(input(\"what is your age: \"))\n",
  23. "year=str((2017-age)+100)\n",
  24. "print(name+\" happy 100 \" +year)\n"
  25. ]
  26. },
  27. {
  28. "cell_type": "code",
  29. "execution_count": 1,
  30. "metadata": {},
  31. "outputs": [
  32. {
  33. "name": "stdout",
  34. "output_type": "stream",
  35. "text": [
  36. "[1, 2, 3, 4]\n"
  37. ]
  38. }
  39. ],
  40. "source": [
  41. "a=[1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10]\n",
  42. "i=int(5)\n",
  43. "new_list=[]\n",
  44. "for k in a :\n",
  45. " if k<i: new_list.append(k)\n",
  46. " \n",
  47. "print(new_list)"
  48. ]
  49. },
  50. {
  51. "cell_type": "code",
  52. "execution_count": 2,
  53. "metadata": {},
  54. "outputs": [
  55. {
  56. "name": "stdout",
  57. "output_type": "stream",
  58. "text": [
  59. "1lZf4%RL\n"
  60. ]
  61. }
  62. ],
  63. "source": [
  64. "\n",
  65. "import random\n",
  66. "\n",
  67. "import1 = \"abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?\"\n",
  68. "passlength = 8\n",
  69. "p = \"\".join(random.sample(import1,passlength ))\n",
  70. "print(p)"
  71. ]
  72. }
  73. ],
  74. "metadata": {
  75. "kernelspec": {
  76. "display_name": "Python 3",
  77. "language": "python",
  78. "name": "python3"
  79. },
  80. "language_info": {
  81. "codemirror_mode": {
  82. "name": "ipython",
  83. "version": 3
  84. },
  85. "file_extension": ".py",
  86. "mimetype": "text/x-python",
  87. "name": "python",
  88. "nbconvert_exporter": "python",
  89. "pygments_lexer": "ipython3",
  90. "version": "3.6.1"
  91. }
  92. },
  93. "nbformat": 4,
  94. "nbformat_minor": 2
  95. }
Add Comment
Please, Sign In to add comment